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

feat(#112): Support nonzero execute exit codes via --execute-non-zero #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TylerJang27
Copy link

@TylerJang27 TylerJang27 commented Jul 2, 2024

Adds a --execute-non-zero flag that, when set, doesn't error when a --execute commands has a nonzero exit code. This allows you to capture the output of commands that are expected to nonzero exit, such as mkdir ., as a toy example.

Please let me know if there's anything else you'd like me to change in this PR!

Fixes #112

@gewenyu99
Copy link

We need this!

@ccoVeille
Copy link
Contributor

this is usually coded with --exit-code that default to 1, if someone wants 0 they can use it

@TylerJang27
Copy link
Author

@ccoVeille could you clarify? Do you mean instead of --execute-non-zero change this to --exit-code (default to 0), which someone would override to --exit-code=1?

@ccoVeille
Copy link
Contributor

I misunderstood what you implemented, I'm sorry. I will let you decide if there is still a need.

git, golangci-lint do like this. And many more.

https://github.com/search?q=language%3Amarkdown+%22--exit-code%22&type=code

I find the parameters more obvious than defining something by its opposite.

But your need is different

@maxandersen
Copy link

literally just hit this - was pretty sad when i realized I couldn't use freeze to "screenshot" error output.

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.

Don't abort if exit code is nonzero
4 participants