Use double test brackets

This commit is contained in:
Luke Childs 2017-01-03 21:26:18 +07:00
parent d03b986535
commit a01c899aec

View File

@ -158,14 +158,14 @@ _zsh_nvm_auto_use() {
local node_version="$(nvm version)" local node_version="$(nvm version)"
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" ] && [ "$nvmrc_node_version" != "$node_version" ]; then if [[ "$nvmrc_node_version" != "N/A" ]] && [[ "$nvmrc_node_version" != "$node_version" ]]; then
nvm use nvm use
export NVM_AUTO_USE_ACTIVE=true 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"
nvm use default nvm use default
fi fi