mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-20 13:47:16 +03:00
Simplify nvm item, everyone is using nvm current now
This commit is contained in:
parent
c577cbee9d
commit
aaf4386dc7
@ -121,10 +121,9 @@ Most of Tide's git capabilities are inherited from fish's built-in [fish_git_pro
|
||||
## nvm
|
||||
|
||||
| Variable | Description | Type |
|
||||
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
|
||||
| -------- | ---------------------------- | ------ |
|
||||
| bg_color | background color of nvm item | color |
|
||||
| color | color of nvm item | color |
|
||||
| default_node | treated as the "system" version of node. The nvm item doesn't display when this version is active. This variable is useful for users of [nvm.fish][], which has no conception of a "system" version. | string |
|
||||
| icon | icon for the nvm item | string |
|
||||
|
||||
## os
|
||||
|
@ -1,12 +1,9 @@
|
||||
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_DIR
|
||||
test -n "$tide_nvm_default_node" -a "$nodeVersion" != "$tide_nvm_default_node"
|
||||
|
||||
if functions --query nvm
|
||||
set -l nvmCurrent (nvm current)
|
||||
if test "$nvmCurrent" != system
|
||||
set_color $tide_nvm_color
|
||||
printf '%s' $tide_nvm_icon' ' $nodeVersion
|
||||
printf '%s' $tide_nvm_icon' ' $nvmCurrent
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user