Make .nvmrc version command more concise

This commit is contained in:
Luke Childs 2017-01-04 15:22:04 +07:00
parent 2f3f7dfc4e
commit 5ce23eee2b

View File

@ -159,7 +159,7 @@ _zsh_nvm_auto_use() {
local nvmrc_path="$(nvm_find_nvmrc)" local nvmrc_path="$(nvm_find_nvmrc)"
if [[ -n "$nvmrc_path" ]]; then if [[ -n "$nvmrc_path" ]]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") local nvmrc_node_version="$(nvm version $(cat "$nvmrc_path"))"
if [[ "$nvmrc_node_version" != "N/A" ]]; then if [[ "$nvmrc_node_version" != "N/A" ]]; then
[[ "$nvmrc_node_version" != "$node_version" ]] && nvm use && export NVM_AUTO_USE_ACTIVE=true [[ "$nvmrc_node_version" != "$node_version" ]] && nvm use && export NVM_AUTO_USE_ACTIVE=true