-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Add --exit-code (-x) flag to enable carrying error codes from task cmds #755
Add --exit-code (-x) flag to enable carrying error codes from task cmds #755
Conversation
Please add some tests to assert on this functionality. |
Hi @BrunoDelor, thanks for your PR! Given this would be a pretty small breaking change, perhaps we could even get rid of the flag and always return the right exit code? Do you guys have an opinion on this? Another question: does other tools like Make does this as well? |
Always returning the right exit code seems logical to me. Looks like
|
Thank you for your comments @ghostsquad If that's would be enough I can add a test that will show that the error code can be exposed through the new @andreynering It appears the question about Make is already answered. |
a4cda9f
to
58c7cc5
Compare
I think maybe this flag could be renamed too. I've seen it described as exit code pass thru. Heroku uses https://github.com/heroku/heroku-run I'm trying to recall specifically where else I've seen this. |
This sounds good to me, I'll push a change for -x --exit-code if this is agreed upon |
Shorthand: -x Longhand: --exit-code
@BrunoDelor Thanks for contributing! ❤️ |
Hello,
I recently found the need to get the return code that was returned from a failed command from a task's cmds. After investigating quickly it appeared to me that the task tool would always return with status code 1 when an error occurred during a task.
This PR proposes an additional command flag (--carry), false by default, that will carry the error code, if any, over to the calling shell.