Skip to content

Commit f07d3e8

Browse files
committed
Add more set options.
1 parent 723abaf commit f07d3e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/backup

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
2-
set -e
2+
set -e # Exit if a command exists with an error.
3+
set -o pipefail # If any command in a pipe exits with an error, treat the whole pipe as failed.
4+
set -u # Fail if a variable is used, but not defined.
35
[ -z "${BACKUP_NAME}" ] && { echo "error: BACKUP_NAME not set"; exit 1; }
46
[ -z "${BACKUP_GPG_KEY_ID}" ] && { echo "error: BACKUP_GPG_KEY_ID not set"; exit 1; }
57
[ -z "${BACKUP_SSH_DESTINATION}" ] && { echo "error: BACKUP_SSH_DESTINATION not set"; exit 1; }

0 commit comments

Comments
 (0)