From c68598931b8e5104233a5467791d5feef214db52 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 16 Nov 2024 16:37:04 +0100 Subject: [PATCH] sh --- shell/alias/shell.sh | 3 +++ shell/main.sh | 3 +++ shell/shell.sh | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/shell/alias/shell.sh b/shell/alias/shell.sh index d38c3cb..531b4b0 100644 --- a/shell/alias/shell.sh +++ b/shell/alias/shell.sh @@ -17,6 +17,9 @@ x() { "${@}" } +# shellcheck disable=SC2154 +[ "${SH}" = "bash" ] || return + # back # shellcheck disable=SC3033 diff --git a/shell/main.sh b/shell/main.sh index 0ccf86b..226062c 100644 --- a/shell/main.sh +++ b/shell/main.sh @@ -1,5 +1,8 @@ [ -n "${ENV}" ] || export ENV="/etc/shell/main.sh" +SH="$(cat /proc/$$/comm)" +export SH + main_source_directory() { local path="${1}" if [ -d "${path}" ]; then diff --git a/shell/shell.sh b/shell/shell.sh index b50964e..edddde6 100644 --- a/shell/shell.sh +++ b/shell/shell.sh @@ -1,10 +1,10 @@ PS1="\$(shell_prompt \${?})" PS2="\ ├ " -SH="$(cat /proc/$$/comm)" shell_color() { local code="${1}" + # shellcheck disable=SC2154 case "${SH}" in "bash") printf "\e[0"