Skip to content

Commit 7fd1955

Browse files
committed
Handle errors nicely even if output is stdout
1 parent b7b9f7f commit 7fd1955

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tokenize

+7-3
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ function main() {
7979
m100-sanity "$f" | m100-tokenize > "$g" || fail=1
8080
fi
8181

82-
echo fail is $fail
8382
if [[ $fail -gt 0 ]]; then
84-
echo "Error detected, removing '$g'" >&2
85-
rm "$g"
83+
echo -n "Error detected"
84+
if [[ $g != "-" ]]; then
85+
echo ", removing '$g'" >&2
86+
rm "$g"
87+
else
88+
echo
89+
fi
8690
exit 1
8791
fi
8892
}

0 commit comments

Comments
 (0)