Skip to content

Commit f535351

Browse files
committed
show both die and exit
1 parent c0a3163 commit f535351

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/assert-no-die-exit.bash

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ if [[ $# -lt 1 ]]; then
55
exit 1
66
fi
77

8+
rc=0
9+
810
# --color=never because magit git output log doesn't support it
911
die_occurrences="$(
1012
grep -H --color=never --line-number -P '\bdie\s*[\(;]' "$@" | grep -v -P 'UnitySite::die'
1113
)" || true
1214
if [ -n "$die_occurrences" ]; then
1315
echo "die is not allowed! use UnitySite::die() instead."
1416
echo "$die_occurrences"
15-
exit 1
17+
rc=1
1618
fi
1719

1820
# --color=never because magit git output log doesn't support it
1921
exit_occurrences="$(grep -H --color=never --line-number -P '\bexit\s*[\(;]' "$@")" || true
2022
if [ -n "$exit_occurrences" ]; then
2123
echo "exit is not allowed! use UnitySite::die() instead."
2224
echo "$exit_occurrences"
23-
exit 1
25+
rc=1
2426
fi
27+
28+
exit "$rc"

0 commit comments

Comments
 (0)