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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
_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!