Swap if conditions round to be more readable

This commit is contained in:
Luke Childs 2017-01-05 13:48:12 +07:00
parent 5ce23eee2b
commit ee87d41ee1

View File

@ -161,10 +161,10 @@ _zsh_nvm_auto_use() {
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
else
nvm install && export NVM_AUTO_USE_ACTIVE=true nvm install && export NVM_AUTO_USE_ACTIVE=true
elif [[ "$nvmrc_node_version" != "$node_version" ]]; then
nvm use && export NVM_AUTO_USE_ACTIVE=true
fi fi
elif [[ "$node_version" != "$(nvm version default)" ]] && [[ "$NVM_AUTO_USE_ACTIVE" = true ]]; then elif [[ "$node_version" != "$(nvm version default)" ]] && [[ "$NVM_AUTO_USE_ACTIVE" = true ]]; then
echo "Reverting to nvm default version" echo "Reverting to nvm default version"