-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
forge create --verify
is incompatible with --json
, gives mixed output
#1976
Comments
There is a |
@rkrasiuk
If so, I think we can skip that and instead implement are spinner or something? @hbarcelos we need to wait until etherscan finished the job and the. way it works is by querying the status of the GUID. |
yup, the repeated logs are caused by the retries, because etherscan doesn't pick up a newly deployed contract for a while. i see they were added at this commit. @joshieDo do u mind if we remove those and do a spinner as @mattsse suggested? |
The problem is not the logs being displayed, but they being sent to I've created a small wrapper to workaround: forge-deploy() {
local RESPONSE=
# Currently `forge create` send the logs to stdout instead of stderr.
# This makes it hard to compose its output with other commands, so here we are:
# 1. Duplicating stdout to stderr through `tee`
# 2. Extracting only the address of the deployed contract to stdout
RESPONSE=$(forge create --keystore="$FOUNDRY_ETH_KEYSTORE_FILE" "$PASSWORD_OPT" --json "$@" | tee >(cat 1>&2))
jq -Rr 'fromjson? | .deployedTo' <<<"$RESPONSE"
} This sends everything to If you are adding a spinner, please make sure to use TOKEN=$(forge create ERC20 --constructor-args 'My Token' 'TOK' 18) won't work. |
forge create
is too verboseforge create
prints logs to stdout
instead of stderr
@rkrasiuk for sure, go ahead |
I'm of the opinion that all regular output should be rendered to Currently the Reference:
|
forge create
prints logs to stdout
instead of stderr
forge create --verify
is incompatible with --json
, gives mixed output
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (123ad0a 2022-06-13T00:06:50.866238846Z)
What command(s) is the bug in?
forge create
Operating System
Linux
Describe the bug
This is the
stdout
of aforge create --verify ...
execution:This makes it very hard to compose the output with other commands (i.e.: store the new contract address into a variable).
It would be good if all of that was sent to
stderr
instead and produce only the contract address instdout
.The text was updated successfully, but these errors were encountered: