File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed
Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -861,13 +861,31 @@ function __bobthefish_prompt_desk -S -d 'Display current desk environment'
861861end
862862
863863function __bobthefish_prompt_nvm -S -d ' Display current node version through NVM'
864- [ " $theme_display_nvm " = ' yes ' -a -n " $NVM_DIR " ]
865- or return
864+ [ " $theme_display_nvm " = ' no ' ]
865+ and return
866866
867- set -l node_version (nvm current 2> /dev/null)
867+ set -l node_version
868+ if type -fq nvm
869+ set node_version (nvm current 2> /dev/null)
868870
869- [ -z $node_version -o " $node_version " = ' none' -o " $node_version " = ' system' ]
870- and return
871+ [ -z $node_version -o " $node_version " = ' none' -o " $node_version " = ' system' ]
872+ and return
873+ else if type -fq nodenv
874+ set node_version (nodenv version-name)
875+
876+ # Don't show global node version...
877+ set -q NODENV_ROOT
878+ or set -l NODENV_ROOT $HOME /.nodenv
879+
880+ [ -e " $NODENV_ROOT /version" ]
881+ and read -l global_node_version < " $NODENV_ROOT /version"
882+
883+ [ " $global_node_version " ]
884+ or set -l global_node_version system
885+
886+ [ " $node_version " = " $global_node_version " ]
887+ and return
888+ end
871889
872890 __bobthefish_start_segment $color_nvm
873891 echo -ns $node_glyph $node_version ' '
You can’t perform that action at this time.
0 commit comments