From ade562aeeb2ee01487a542bccb415179a01ed40e Mon Sep 17 00:00:00 2001 From: Nicolas Chan Date: Thu, 4 Mar 2021 11:50:10 -0800 Subject: [PATCH] Fix shellcheck --- backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup.sh b/backup.sh index 9a78198..4100f73 100755 --- a/backup.sh +++ b/backup.sh @@ -311,7 +311,7 @@ array-sum () { # Given two exit codes, print a nonzero one if there is one exit-code () { - if [ $1 -ne 0 ]; then + if [ "$1" -ne 0 ]; then echo "$1" else if [[ "$2" == "" ]]; then @@ -388,7 +388,7 @@ case $COMPRESSION_ALGORITHM in ;; esac ARCHIVE_EXIT_CODE="$(exit-code "${PIPESTATUS[0]}" "${PIPESTATUS[1]}")" -if [ $ARCHIVE_EXIT_CODE -ne 0 ]; then +if [ "$ARCHIVE_EXIT_CODE" -ne 0 ]; then log-fatal "Archive command exited with nonzero exit code $ARCHIVE_EXIT_CODE" fi sync