Skip to content

Commit 5c09cac

Browse files
committed
Fix e2e to avoid undef var
1 parent 59af7bf commit 5c09cac

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test_e2e.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,6 @@ function assert_file_eq() {
5252
fail "file $1 does not contain '$2': $(cat $1)"
5353
}
5454

55-
function finish() {
56-
if [ $? -ne 0 ]; then
57-
echo "The directory $DIR was not removed as it contains"\
58-
"log files useful for debugging"
59-
remove_sync_container
60-
fi
61-
}
62-
63-
trap finish INT EXIT
64-
6555
# #####################
6656
# main
6757
# #####################
@@ -80,6 +70,16 @@ if [[ -z "$DIR" ]]; then
8070
fi
8171
echo "test root is $DIR"
8272

73+
function finish() {
74+
if [ $? -ne 0 ]; then
75+
echo "The directory $DIR was not removed as it contains"\
76+
"log files useful for debugging"
77+
remove_sync_container
78+
fi
79+
}
80+
81+
trap finish INT EXIT
82+
8383
CONTAINER_NAME=git-sync-$RANDOM
8484
function GIT_SYNC() {
8585
#./bin/linux_amd64/git-sync "$@"

0 commit comments

Comments
 (0)