Created
August 21, 2018 17:37
-
-
Save alexfinnarn/e285625bdefd54393a281139a91f7596 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This function takes the output of the last command and exits if it failed. | |
earlyexit() { | |
CODE="$?" | |
if [ "${CODE}" != "0" ]; then | |
echo --- | |
echo Exiting on failure... | |
echo --- | |
exit 1 | |
fi | |
echo Script succeeded. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment