Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Fix for issue #543: updated all exit calls with a unique return code #544

Closed
wants to merge 2 commits into from

Conversation

danielritchie
Copy link
Contributor

_deploy/lib/ml.rb_ presently exits with errors using "exit!" This forces an immediate exit that bypasses handling and returns "1". Using this method also causes something strange to happen with the output of the script, preventing redirection and other concerns See: Issue #543

All "exit!" calls have been replaced with "exit #" as I couldn't see any reason why the use of return codes would be problematic. I believe this maintains all existing functionality, and is a desirable enhancement.

There was a single "exit" call which was also replaced with a unique return code, "exit 10" - Note that this will change exiting behavior ("exit" alone will return 0). Although I expect this will be a desired addition, I wanted to call it out since it does change the return code.

More detail from Ruby docs:
exit vs. exit!

@danielritchie
Copy link
Contributor Author

With unique return codes being available, it seemed worthwhile to pass them back to the parent script.

Previous behavior:
# ./ml bootstrap
ERROR MESSAGE
# echo $?
1
With this change:
# ./ml bootstrap
ERROR MESSAGE
# echo $?
7

@danielritchie
Copy link
Contributor Author

Closing - Realized I need to submit an updated pull request to the dev branch

@danielritchie
Copy link
Contributor Author

Updated pull request: #546

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants