mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
Merge 03576d614c
into 977563e97d
This commit is contained in:
commit
062000016b
7
nvm-exec
7
nvm-exec
@ -8,6 +8,13 @@ unset NVM_CD_FLAGS
|
||||
\. "$DIR/nvm.sh" --no-use
|
||||
|
||||
if [ -n "$NODE_VERSION" ]; then
|
||||
CURRENT_VERSION=$(nvm current)
|
||||
|
||||
if [ "$CURRENT_VERSION" == "$NODE_VERSION" ]; then
|
||||
echo "Node.js version $NODE_VERSION is already active."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
nvm use "$NODE_VERSION" > /dev/null || exit 127
|
||||
elif ! nvm use >/dev/null 2>&1; then
|
||||
echo "No NODE_VERSION provided; no .nvmrc file found" >&2
|
||||
|
Loading…
Reference in New Issue
Block a user