Permalink
Browse files

Merge pull request #191 from koenpunt/patch-1

Add exit code, fix #190
  • Loading branch information...
2 parents e145978 + 70e1b81 commit 87a76af398a42d7a12472d55d021e8d245d8995c @creationix committed Jan 21, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 nvm.sh
View
2 nvm.sh
@@ -351,7 +351,7 @@ nvm()
VERSION=`nvm_version $2`
if [ ! -d $NVM_DIR/$VERSION ]; then
echo "$VERSION version is not installed yet"
- return;
+ exit 1
fi
if [[ $PATH == *$NVM_DIR/*/bin* ]]; then
PATH=${PATH%$NVM_DIR/*/bin*}$NVM_DIR/$VERSION/bin${PATH#*$NVM_DIR/*/bin}

5 comments on commit 87a76af

With this commit running . ~/.nvm/nvm.sh exits my console. And if this command is run by another script it is terminated.

Owner

creationix replied Jan 21, 2013

Oops, I should have looked closer to that. It needs to be return 1 not exit 1. Remember that nvm is run as a bash function, not a script process.

Owner

creationix replied Jan 21, 2013

Should be fixed now.

Contributor

koenpunt replied Jan 21, 2013

@creationix You're right, my bad. Sorry..

Yeap, working fine. Many thanks for the fast fix!

Please sign in to comment.