-
-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvm.sh not working with "set -e" #1062
Comments
@Richie765 |
Ah right, Homebrew isn't supported. I'm sure you have good reason for that. It's too much work for me to install it "properly" just for testing this. It's probably a lot easier for you to do. Just call For me it exits with exit code 3. The last lines of a trace are as follows: $ cat test
#!/bin/sh
set -e
set -x
export NVM_DIR=~/.nvm
. $(brew --prefix nvm)/nvm.sh
$ ./test
<cut>
+++++ command sed '
s#/homepath/.nvm/versions/io.js/#iojs-#;
\#/homepath/.nvm/versions/io.js# d;
s#^/homepath/.nvm/##;
\#^versions$# d;
s#^versions/##;
s#^v#node-v#;
s#^\(iojs\)[-/]v#\1.v#;
s#^\(node\)[-/]v#\1.v#'
+++++ sed '
s#/homepath/.nvm/versions/io.js/#iojs-#;
\#/homepath/.nvm/versions/io.js# d;
s#^/homepath/.nvm/##;
\#^versions$# d;
s#^versions/##;
s#^v#node-v#;
s#^\(iojs\)[-/]v#\1.v#;
s#^\(node\)[-/]v#\1.v#'
+++++ command sort -t. -u -k 2.2,2n -k 3,3n -k 4,4n
+++++ sort -t. -u -k 2.2,2n -k 3,3n -k 4,4n
+++++ command sed '
s/^\(iojs\)\./\1-/;
s/^node\.//'
+++++ sed '
s/^\(iojs\)\./\1-/;
s/^node\.//'
++++ VERSIONS=
++++ '[' 1 -eq 1 ']'
++++ nvm_has unsetopt
++++ type unsetopt
++++ '[' false = true ']'
++++ '[' -z '' ']'
++++ echo N/A
++++ return 3
+++ VERSION=N/A
+++ '[' -z N/A ']'
+++ '[' _N/A = _N/A ']'
+++ echo N/A
+++ return 3
++ VERSION=N/A
$ echo $?
3
$ Hope this helps. If you don't want to look into it it's fine with me too. |
I'd love to look into it - however, for me, it doesn't exit at all, because I've already tested it with I'm not sure why it's too much trouble to Thanks for the trace! What happens if you wait to |
You're right, it's easy to setup. I just did it and the problem disappeared. Sorry to bother you with it! |
np, thanks for confirming! |
If nvm.sh does run successfully, why is it exiting with code 3 instead of 0? |
I like to run most of my scripts with
set -e
so they terminate whenever there is a problem.If I run the following in my .bashrc
It will terminate during
nvm.sh
with an exit code. Obviously I can work around that but perhaps it could be fixed.The text was updated successfully, but these errors were encountered: