Fixed script from aborting after an error from zsh already installed

This commit is contained in:
alvinlollo
2025-01-30 03:09:32 +00:00
parent c5928e9b0d
commit 2df958c97f
+16
View File
@@ -14,6 +14,22 @@ echo '
--------------- Single Download script ---------------
'
# Prints its arguments to stderr and exits with a non-zero value.
#
# If no arguments are given, it exits with the current value of $?.
# If arguments are given, it exits with 1.
#
# This function is intended to be used to print error messages.
die() {
local rc=$?
if (( $# > 0 )); then
printf '%s\n' "$@" >&2
rc=1
fi
exit "$rc"
}
# Fail on any command.
set -eux pipefail