diff --git a/lib/menu-functions.sh b/lib/menu-functions.sh index dc0558c..23a457d 100644 --- a/lib/menu-functions.sh +++ b/lib/menu-functions.sh @@ -20,7 +20,11 @@ set -eo pipefail # Bash version check if [ "${BASH_VERSINFO[0]}" -lt 4 ] || ([ "${BASH_VERSINFO[0]}" -eq 4 ] && [ "${BASH_VERSINFO[1]}" -lt 1 ]); then echo "[ERROR] menu-functions.sh requires Bash 4.1 or later (detected: ${BASH_VERSION})" >&2 - return 1 2>/dev/null || exit 1 + if [ "${BASH_SOURCE[0]}" = "${0}" ]; then + exit 1 + else + return 1 + fi fi ################################################################################