mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-10-31 01:45:50 +08:00
Make sure sourcing nvm.sh on shells that don't support source options doesn't exit nonzero.
Fixes #721
This commit is contained in:
2
nvm.sh
2
nvm.sh
@@ -1784,7 +1784,7 @@ nvm_supports_source_options() {
|
||||
[ "_$(echo 'echo $1' | . /dev/stdin yes 2> /dev/null)" = "_yes" ]
|
||||
}
|
||||
|
||||
VERSION="$(nvm_alias default 2>/dev/null)"
|
||||
VERSION="$(nvm_alias default 2>/dev/null || echo)"
|
||||
if nvm_supports_source_options && [ "_$1" = "_--install" ]; then
|
||||
if [ -n "$VERSION" ]; then
|
||||
nvm install "$VERSION" >/dev/null
|
||||
|
||||
Reference in New Issue
Block a user