mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-17 11:03:44 +00:00
Compare commits
2 Commits
bfa2f572a3
...
e65fb46fcd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e65fb46fcd | ||
![]() |
05feeaa927 |
1
nvm-exec
1
nvm-exec
@ -7,6 +7,7 @@ unset NVM_CD_FLAGS
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
\. "$DIR/nvm.sh" --no-use
|
||||
|
||||
nvm_rc_version > /dev/null && nvm_ensure_version_installed "$NVM_RC_VERSION";
|
||||
if [ -n "$NODE_VERSION" ]; then
|
||||
nvm use "$NODE_VERSION" > /dev/null || exit 127
|
||||
elif ! nvm use >/dev/null 2>&1; then
|
||||
|
18
test/fast/Running 'nvm-exec' should display required node version
Executable file
18
test/fast/Running 'nvm-exec' should display required node version
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
\. ../../nvm.sh
|
||||
|
||||
NVM_TEST_VERSION=v0.42
|
||||
|
||||
# Write it to nvmrc
|
||||
echo "$NVM_TEST_VERSION" > .nvmrc
|
||||
|
||||
OUTPUT="$(../../nvm-exec 2>&1)";
|
||||
EXPECTED="N/A: version \"${NVM_TEST_VERSION}\" is not yet installed.
|
||||
|
||||
You need to run \`nvm install ${NVM_TEST_VERSION}\` to install and use it.
|
||||
No NODE_VERSION provided; no .nvmrc file found";
|
||||
|
||||
# Skip install, we want to test the error message
|
||||
diff <(echo "${EXPECTED}") <(echo "${OUTPUT}")
|
Loading…
x
Reference in New Issue
Block a user