mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-25 13:06:32 +03:00
13 lines
600 B
Fish
13 lines
600 B
Fish
function _tide_item_nvm
|
|
if set -l nodePath (command --search node) # Ensure node is installed
|
|
set -l nodeVersion (string split / $nodePath)[-3] # Much faster than node --version
|
|
|
|
if string match --quiet --regex "^$NVM_DIR.*" $nodePath # If node path begins with nvm directory
|
|
set_color $tide_nvm_color
|
|
printf '%s' $tide_nvm_icon' ' $nodeVersion
|
|
else if test -n "$tide_nvm_default_node" -a "$tide_nvm_default_node" != "$nodeVersion"
|
|
set_color $tide_nvm_color
|
|
printf '%s' $tide_nvm_icon' ' $nodeVersion
|
|
end
|
|
end
|
|
end |