mirror of
https://github.com/lukechilds/zsh-nvm.git
synced 2025-02-06 09:55:31 +08:00
more optimizations
This commit is contained in:
parent
3d6db8f1eb
commit
a55dc057d9
@ -162,14 +162,22 @@ _zsh_nvm_revert() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_current_node_version() {
|
_current_node_version() {
|
||||||
local node_path="$(command which node 2>/dev/null)"
|
if _node_is_nvm; then
|
||||||
if [[ -z "${node_path##$NVM_DIR*}" ]]; then
|
|
||||||
node --version 2>/dev/null
|
node --version 2>/dev/null
|
||||||
else
|
else
|
||||||
printf 'system'
|
printf 'system'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_node_is_nvm() {
|
||||||
|
local node_path="$(command which node 2>/dev/null)"
|
||||||
|
if [[ -z "${node_path##$NVM_DIR*}" ]]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
_nvm_default_version() {
|
_nvm_default_version() {
|
||||||
local alias="$(nvm_resolve_alias default)"
|
local alias="$(nvm_resolve_alias default)"
|
||||||
if [[ "$alias" = 'node' ]]; then
|
if [[ "$alias" = 'node' ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user