Skip to content

Commit

Permalink
more optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
henderea committed Jun 7, 2022
1 parent 3f9a6b8 commit ff5e09a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions zsh-nvm.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,22 @@ _zsh_nvm_revert() {
}

_current_node_version() {
local node_path="$(command which node 2>/dev/null)"
if [[ -z "${node_path##$NVM_DIR*}" ]]; then
if _node_is_nvm; then
node --version 2>/dev/null
else
printf 'system'
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() {
local alias="$(nvm_resolve_alias default)"
if [[ "$alias" = 'node' ]]; then
Expand Down

0 comments on commit ff5e09a

Please sign in to comment.