-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure sourcing
nvm.sh
on shells that don't support source optio…
…ns doesn't exit nonzero. Fixes #721
- Loading branch information
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
test/sourcing/Sourcing nvm.sh with no default should return 0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
die () { echo $@ ; exit 1; } | ||
|
||
touch ../../alias/default | ||
rm ../../alias/default || die 'removal of default alias failed' | ||
nvm_alias default && die '"nvm_alias default" did not fail' | ||
|
||
set -e # necessary to fail internally with a nonzero code | ||
|
||
. ../../nvm.sh || die 'sourcing returned nonzero exit code' |