Removed PREVIOUS_NODE_PATH

master
Tarcisio Gruppi 2014-01-13 09:15:45 -02:00
parent 58dafdaedd
commit eb588566f2
No known key found for this signature in database
GPG Key ID: 36F5005FCAF5C057
1 changed files with 3 additions and 6 deletions

9
nvm.sh
View File

@ -446,16 +446,13 @@ nvm() {
echo "$VERSION version is not installed yet" echo "$VERSION version is not installed yet"
return; return;
fi fi
PREVIOUS_NODE_PATH=$NODE_PATH
if [[ $NODE_PATH == *$NVM_DIR/*/lib/node_modules* ]]; then if [[ $NODE_PATH == *$NVM_DIR/*/lib/node_modules* ]]; then
NODE_PATH=${NODE_PATH%$NVM_DIR/*/lib/node_modules*}$NVM_DIR/$VERSION/lib/node_modules${NODE_PATH#*$NVM_DIR/*/lib/node_modules} RUN_NODE_PATH=${NODE_PATH%$NVM_DIR/*/lib/node_modules*}$NVM_DIR/$VERSION/lib/node_modules${NODE_PATH#*$NVM_DIR/*/lib/node_modules}
else else
NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules:$NODE_PATH" RUN_NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules:$NODE_PATH"
fi fi
export NODE_PATH
echo "Running node $VERSION" echo "Running node $VERSION"
$NVM_DIR/$VERSION/bin/node "${@:3}" NODE_PATH=$RUN_NODE_PATH $NVM_DIR/$VERSION/bin/node "${@:3}"
export NODE_PATH=$PREVIOUS_NODE_PATH
;; ;;
"ls" | "list" ) "ls" | "list" )
print_versions "`nvm_ls $2`" print_versions "`nvm_ls $2`"