Commit b5490e33 authored by Matthew Brett's avatar Matthew Brett
Browse files

errexit_set var to lowercase

Uppercase variable looked more official, and so - to me - was confusing.
parent 2bb607c8
...@@ -117,14 +117,14 @@ function suppress { ...@@ -117,14 +117,14 @@ function suppress {
# Set -e stuff agonized over in # Set -e stuff agonized over in
# https://unix.stackexchange.com/questions/296526/set-e-in-a-subshell # https://unix.stackexchange.com/questions/296526/set-e-in-a-subshell
local tmp=$(mktemp tmp.XXXXXXXXX) || return local tmp=$(mktemp tmp.XXXXXXXXX) || return
local ERREXIT_SET OUT local errexit_set
echo "Running $@" echo "Running $@"
if [[ $- = *e* ]]; then ERREXIT_SET=true; fi if [[ $- = *e* ]]; then errexit_set=true; fi
set +e set +e
( if [[ -n $ERREXIT_SET ]]; then set -e; fi; "$@" > "$tmp" 2>&1 ) ; ret=$? ( if [[ -n $errexit_set ]]; then set -e; fi; "$@" > "$tmp" 2>&1 ) ; ret=$?
[ "$ret" -eq 0 ] || cat "$tmp" [ "$ret" -eq 0 ] || cat "$tmp"
rm -f "$tmp" rm -f "$tmp"
if [[ -n $ERREXIT_SET ]]; then set -e; fi if [[ -n $errexit_set ]]; then set -e; fi
return "$ret" return "$ret"
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment