From 86aca2389830852466d0ddf2a73110c634ceda01 Mon Sep 17 00:00:00 2001 From: ale5000 <15793015+ale5000-git@users.noreply.github.com> Date: Mon, 7 Aug 2023 05:30:15 +0200 Subject: [PATCH] Minor change --- zip-content/inc/common-functions.sh | 9 ++++++++- zip-content/scripts/install.sh | 7 ------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zip-content/inc/common-functions.sh b/zip-content/inc/common-functions.sh index 9d6349a9..1bd874d3 100644 --- a/zip-content/inc/common-functions.sh +++ b/zip-content/inc/common-functions.sh @@ -9,7 +9,14 @@ # shellcheck disable=SC3043 # SC3043: In POSIX sh, local is undefined -### PREVENTIVE CHECKS ### +### PREVENTIVE CHECKS AND SETTINGS ### + +# shellcheck disable=SC3040,SC2015 +{ + # Unsupported set options may cause the shell to exit (even without set -e), so first try them in a subshell to avoid this issue + (set -o posix 2> /dev/null) && set -o posix || true + (set -o pipefail) && set -o pipefail || true +} if test -z "${ZIPFILE:-}" || test -z "${TMP_PATH:-}" || test -z "${RECOVERY_PIPE:-}" || test -z "${OUTFD:-}" || test -z "${INPUT_FROM_TERMINAL:-}" || test -z "${DEBUG_LOG_ENABLED:-}"; then echo 'Some variables are NOT set.' diff --git a/zip-content/scripts/install.sh b/zip-content/scripts/install.sh index 757add39..6a5f8512 100644 --- a/zip-content/scripts/install.sh +++ b/zip-content/scripts/install.sh @@ -14,13 +14,6 @@ unset UNZIPOPT unset UNZIP_OPTS unset CDPATH -# shellcheck disable=SC3040,SC2015 -{ - # Unsupported set options may cause the shell to exit (even without set -e), so first try them in a subshell to avoid this issue - (set -o posix 2> /dev/null) && set -o posix || true - (set -o pipefail) && set -o pipefail || true -} - ### GLOBAL VARIABLES ### TMP_PATH="${2:?}"