Last active
August 29, 2015 14:12
-
-
Save benmoss/fe7486832e81890f3234 to your computer and use it in GitHub Desktop.
set -e semantics
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
#!/bin/bash | |
set -e | |
function log_exit { | |
echo "exiting with status $?" | |
} | |
trap log_exit EXIT | |
function check_documentation_coverage { | |
ruby -e "exit(1)" | |
ruby -e "exit(0)" | |
} | |
status=0 | |
echo "checking documentation coverage" | |
check_documentation_coverage || status=$? | |
echo "got a status of $status" | |
echo "checking again" | |
check_documentation_coverage | |
status=$? | |
echo "got a status of $status" |
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
checking documentation coverage | |
got a status of 0 | |
checking again | |
exiting with status 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment