fix: only use the RETURN signal for the suppress file removal

Closes #3473
This commit is contained in:
Jose Diaz-Gonzalez committed 2019-05-20 18:01:03 -07:00
1 parent da4361583b
commit c8a491ed7f
1 file changed
+1 -1
+1 -1
View File
@@ -1080,7 +1080,7 @@ suppress_output() {
declare desc="suppress all output from a given command unless there is an error"
local TMP_COMMAND_OUTPUT
TMP_COMMAND_OUTPUT=$(mktemp "/tmp/${FUNCNAME[0]}.XXXX")
trap 'rm -rf "$TMP_COMMAND_OUTPUT" >/dev/null' RETURN INT TERM EXIT
trap "rm -rf '$TMP_COMMAND_OUTPUT' >/dev/null" RETURN
"$@" >"$TMP_COMMAND_OUTPUT" 2>&1 || {
local exit_code="$?"