Skip to content
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

fix(forge): forge script --json always returns zero exit code #2508 #7071

Conversation

zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Feb 9, 2024

Motivation

Closes: #2508

Currently there is an issue where script errors get skipped if --json is passed to forge script as the execution path lacks the success check.

Solution

Adds missing success check and two test cases to check equivalency of behaviour.

Similar to show_traces the error check is performed at the end so that useful stdout logs can still be captured.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty

@mattsse mattsse merged commit 174752f into foundry-rs:master Feb 10, 2024
18 of 19 checks passed
@zerosnacks zerosnacks deleted the fix/forge-script-json-always-returns-zero-exit-code branch March 8, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

forge script --json always returns a zero status
2 participants