Skip to content

Commit 0bf8782

Browse files

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/bash/sdkman-init.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ esac
5858
zsh_shell=false
5959
bash_shell=false
6060

61-
if [[ -n "$ZSH_VERSION" ]]; then
61+
if [[ -n "${ZSH_VERSION:-}" ]]; then
6262
zsh_shell=true
63-
elif [[ -n "$BASH_VERSION" ]]; then
63+
elif [[ -n "${BASH_VERSION:-}" ]]; then
6464
bash_shell=true
6565
fi
6666

@@ -166,7 +166,7 @@ if [[ "$sdkman_auto_env" == "true" ]]; then
166166

167167
export SDKMAN_OLD_PWD="$PWD"
168168
}
169-
169+
170170
trimmed_prompt_command="${PROMPT_COMMAND%"${PROMPT_COMMAND##*[![:space:]]}"}"
171171
[[ -z "$trimmed_prompt_command" ]] && PROMPT_COMMAND="sdkman_auto_env" || PROMPT_COMMAND="${trimmed_prompt_command%\;};sdkman_auto_env"
172172
fi

0 commit comments

Comments
 (0)