diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2017-05-23 04:45:17 +0300 |
---|---|---|
committer | Ben Hilburn <bhilburn@gmail.com> | 2017-05-23 04:45:17 +0300 |
commit | 643e8372db1d5168a6651b982e5c9f5347f9910a (patch) | |
tree | 9092a14ae5d4d204281d5c5eead00a192fceeffe /powerlevel9k.zsh-theme | |
parent | 5beb77bdf404ad77032478109d24dfbec26ae7c7 (diff) | |
parent | 65f5f7a90fbac578331581dc0dab79c068f75fe2 (diff) |
Merge branch 'next' of github.com:bhilburn/powerlevel9k into next
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index d570da9f..c2696669 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -807,12 +807,12 @@ prompt_detect_virt() { if [[ "$virt" == "none" ]]; then if [[ "$(ls -di / | grep -o 2)" != "2" ]]; then virt="chroot" - "$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$virt" + "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "$virt" else ; fi else - "$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$virt" + "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "$virt" fi } @@ -906,13 +906,16 @@ prompt_node_version() { # Node version from NVM # Only prints the segment if different than the default value prompt_nvm() { - [[ ! $(type nvm) =~ 'nvm is a shell function'* ]] && return - local node_version=$(nvm current) - [[ -z "${node_version}" ]] || [[ ${node_version} = "none" ]] && return - local nvm_default=$(cat $NVM_DIR/alias/default) + local node_version nvm_default + (( $+functions[nvm_version] )) || return + + node_version=$(nvm_version current) + [[ -z "${node_version}" || ${node_version} == "none" ]] && return + + nvm_default=$(nvm_version default) [[ "$node_version" =~ "$nvm_default" ]] && return - $1_prompt_segment "$0" "$2" "green" "011" "${node_version:1}" 'NODE_ICON' + $1_prompt_segment "$0" "$2" "magenta" "black" "${node_version:1}" 'NODE_ICON' } # NodeEnv Prompt |