From 63997d2285a67aa58fbe1699d370d832594ee783 Mon Sep 17 00:00:00 2001 From: "Lockszmith (@wolfpack)" Date: Tue, 3 Dec 2024 08:21:02 -0500 Subject: [PATCH] Shell detection syntax fixed --- _home/private_dot_local/bin/executable_szetup-kubectl4k3s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_home/private_dot_local/bin/executable_szetup-kubectl4k3s b/_home/private_dot_local/bin/executable_szetup-kubectl4k3s index d82f8b0..1ec4e51 100644 --- a/_home/private_dot_local/bin/executable_szetup-kubectl4k3s +++ b/_home/private_dot_local/bin/executable_szetup-kubectl4k3s @@ -5,7 +5,7 @@ # SC1090 Can't follow non-constant source # User basename instead of ${0:##*/} to be POSIX compliant -BASE_0=${BASE_0:-$(basename $0)} +BASE_0=${BASE_0:-$(basename ${0#-})} SCRIPT_DIR=${SCRIPT_DIR:-"$( cd -- "$( dirname -- "$0" )" &> /dev/null && pwd )"} BASE_SHELL=$(basename "$SHELL") @@ -15,7 +15,7 @@ is_sourced() { case $ZSH_EVAL_CONTEXT in *:file:*) return 0;; esac else # case ${0##*/} in dash|-dash|bash|-bash|ksh|-ksh|sh|-sh) return 0;; esac - case "$(basename $0)" in $BASE_SHELL|-$BASE_SHELL) return 0;; esac + case "${BASE_0}" in $BASE_SHELL|-$BASE_SHELL) return 0;; esac fi return 1; # NOT sourced. }