mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-16 18:43:43 +00:00
Compare commits
4 Commits
328ff2258f
...
55da18539c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
55da18539c | ||
![]() |
650b069bb8 | ||
![]() |
5a28180ed6 | ||
![]() |
e2ff1e7f08 |
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
|
||||
|
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
\. ../../nvm.sh
|
||||
|
||||
NVM_TEST_VERSION=v9
|
||||
|
||||
# Remove the stuff we're clobbering.
|
||||
[ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION
|
||||
|
||||
# Write it to nvmrc
|
||||
echo "$NVM_TEST_VERSION" > .nvmrc
|
||||
|
||||
output="$(../../nvm-exec 2>&1)";
|
||||
expected='N/A: version "v9" is not yet installed.
|
||||
|
||||
You need to run `nvm install v9` 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