mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-21 06:12:31 +03:00
Replace which with command --search
This commit is contained in:
parent
8f2b0917c8
commit
81cfe19b0f
@ -1,13 +1,13 @@
|
||||
function _tide_item_nvm
|
||||
if set -l whichNode (which node 2>/dev/null) # Ensure node is installed
|
||||
set -l nodeVersion (string split / $whichNode)[-3] # Much faster than node --version
|
||||
if set -l nodePath (command --search node) # Ensure node is installed
|
||||
set -l nodeVersion (string split / $nodePath)[-3] # Much faster than 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
|
||||
else 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
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user