Compare commits

...

4 Commits

Author SHA1 Message Date
Bark
55da18539c
Merge 650b069bb83c0d704cb48e2a59468a021d7cdcd8 into ff1257e8e3059ae01928c4261a41de2260bcd968 2024-07-30 08:57:02 +00:00
Stiliyan Tonev (Bark)
650b069bb8 Seems changes done in docker do not persist, had to reapply them 2024-07-30 11:56:35 +03:00
Stiliyan Tonev (Bark)
5a28180ed6 tests: Add test to check if the message contains the relevant information. 2024-07-30 11:51:32 +03:00
Bark
e2ff1e7f08 fix: Do a version check on nvm-exec
This check would display a message in case the `.nvmrc` version is not installed, and would not alter the output otherwise.
2024-03-06 16:03:10 +02:00
2 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -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")