mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-24 20:41:36 +03:00
nvm item revision
This commit is contained in:
parent
fa23a38efc
commit
ae4a33e719
@ -1,23 +1,15 @@
|
||||
function _tide_node_version
|
||||
function top_level_dir --argument-names dirPath
|
||||
echo (string split --max 2 / $dirPath)[2]
|
||||
end
|
||||
|
||||
set -l node_path_begin (top_level_dir (which node 2>/dev/null))
|
||||
set -l home_path_begin (top_level_dir $HOME)
|
||||
|
||||
if test $node_path_begin = $home_path_begin;
|
||||
echo (node --version)
|
||||
else;
|
||||
echo "system"
|
||||
end
|
||||
end
|
||||
|
||||
function _tide_item_nvm
|
||||
set -l node_version (_tide_node_version)
|
||||
if set -l whichNode (which node 2>/dev/null) # Ensure node is installed
|
||||
set -l nodeVersion (node --version)
|
||||
|
||||
if test "$node_version" != "system" -a -n "$node_version"
|
||||
set_color $tide_nvm_color
|
||||
printf '%s ' "$tide_nvm_icon $node_version"
|
||||
if test -n "$tide_nvm_default_node"
|
||||
if test "$tide_nvm_default_node" != "$nodeVersion"
|
||||
set_color $tide_nvm_color
|
||||
printf '%s' {$tide_nvm_icon}' ' $nodeVersion
|
||||
end
|
||||
else if string match --quiet --regex "^$NVM_DIR.*" $whichNode # If node path begins with nvm directory
|
||||
set_color $tide_nvm_color
|
||||
printf '%s' $tide_nvm_icon' ' $nodeVersion
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -36,6 +36,9 @@ tide_left_prompt_items 'pwd' 'git_prompt' 'newline'
|
||||
tide_left_prompt_pad_items true
|
||||
tide_left_prompt_prefix ''
|
||||
tide_left_prompt_suffix ''
|
||||
tide_nvm_color 00AFAF
|
||||
tide_nvm_default_node
|
||||
tide_nvm_icon '⬢'
|
||||
tide_os_bg_color 444444
|
||||
tide_os_color EEEEEE
|
||||
tide_os_use_nearest true
|
||||
@ -82,6 +85,4 @@ tide_time_format '%T'
|
||||
tide_virtual_env_bg_color 444444
|
||||
tide_virtual_env_color 00AFAF
|
||||
tide_virtual_env_display_mode 'projectName'
|
||||
tide_virtual_env_icon ''
|
||||
tide_nvm_color 00AFAF
|
||||
tide_nvm_icon ''
|
||||
tide_virtual_env_icon ''
|
@ -36,6 +36,9 @@ tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char'
|
||||
tide_left_prompt_pad_items false
|
||||
tide_left_prompt_prefix ''
|
||||
tide_left_prompt_suffix ' '
|
||||
tide_nvm_color 00AFAF
|
||||
tide_nvm_default_node
|
||||
tide_nvm_icon '⬢'
|
||||
tide_os_bg_color normal
|
||||
tide_os_color normal
|
||||
tide_os_use_nearest true
|
||||
@ -82,6 +85,4 @@ tide_time_format '%T'
|
||||
tide_virtual_env_bg_color normal
|
||||
tide_virtual_env_color 00AFAF
|
||||
tide_virtual_env_display_mode 'projectName'
|
||||
tide_virtual_env_icon ''
|
||||
tide_nvm_color 00AFAF
|
||||
tide_nvm_icon ''
|
||||
tide_virtual_env_icon ''
|
@ -36,6 +36,9 @@ tide_left_prompt_items 'pwd' 'git_prompt' 'cmd_duration' 'nvm' 'virtual_env' 'ne
|
||||
tide_left_prompt_pad_items false
|
||||
tide_left_prompt_prefix ''
|
||||
tide_left_prompt_suffix ' '
|
||||
tide_nvm_color 00AFAF
|
||||
tide_nvm_default_node
|
||||
tide_nvm_icon '⬢'
|
||||
tide_os_bg_color normal
|
||||
tide_os_color normal
|
||||
tide_os_use_nearest true
|
||||
@ -82,6 +85,4 @@ tide_time_format '%T'
|
||||
tide_virtual_env_bg_color normal
|
||||
tide_virtual_env_color 00AFAF
|
||||
tide_virtual_env_display_mode 'projectName'
|
||||
tide_virtual_env_icon ''
|
||||
tide_nvm_color 00AFAF
|
||||
tide_nvm_icon ''
|
||||
tide_virtual_env_icon ''
|
@ -36,6 +36,9 @@ tide_left_prompt_items 'pwd' 'git_prompt' 'newline'
|
||||
tide_left_prompt_pad_items true
|
||||
tide_left_prompt_prefix ''
|
||||
tide_left_prompt_suffix ''
|
||||
tide_nvm_color 00AFAF
|
||||
tide_nvm_default_node
|
||||
tide_nvm_icon '⬢'
|
||||
tide_os_bg_color CED7CF
|
||||
tide_os_color 080808
|
||||
tide_os_use_nearest true
|
||||
@ -82,6 +85,4 @@ tide_time_format '%T'
|
||||
tide_virtual_env_bg_color 444444
|
||||
tide_virtual_env_color 00AFAF
|
||||
tide_virtual_env_display_mode 'projectName'
|
||||
tide_virtual_env_icon ''
|
||||
tide_nvm_color 00AFAF
|
||||
tide_nvm_icon ''
|
||||
tide_virtual_env_icon ''
|
Loading…
Reference in New Issue
Block a user