Enable direnv bash hook if program is found

This commit is contained in:
2021-02-10 19:44:00 -05:00
parent 73e19c6a70
commit 7c206fe202
2 changed files with 31 additions and 30 deletions

View File

@@ -11,3 +11,13 @@ abort() {
exit 1
}
# Use this by setting a trap in your script, like so:
# `trap at_exit EXIT`
at_exit() {
ret=$?
if [[ $ret -gt 0 ]]; then
error "The script failed with error $ret.\n"
fi
exit "$ret"
}