Skip to content

Commit d5479b2

Browse files
committed
Use set -u in init script
This is already done in the other shell scripts. Although init-tests-after-clone.sh does not have as many places where a bug could slip through by an inadvertently nonexistent parameter, it does have $answer (and it may have more expansions in the future).
1 parent 5060c9d commit d5479b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

init-tests-after-clone.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22

3-
set -e
3+
set -eu
44

5-
if test -z "$TRAVIS"; then
5+
if test -z "${TRAVIS-}"; then
66
printf 'This operation will destroy locally modified files. Continue ? [N/y]: ' >&2
77
read -r answer
88
case "$answer" in
@@ -29,7 +29,7 @@ git reset --hard HEAD~1
2929
git reset --hard __testing_point__
3030

3131
# Do some setup that CI takes care of but that may not have been done locally.
32-
if test -z "$TRAVIS"; then
32+
if test -z "${TRAVIS-}"; then
3333
# The tests needs some version tags. Try to get them even in forks.
3434
git fetch --all --tags
3535

0 commit comments

Comments
 (0)