mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-07-18 12:58:21 +08:00
Adding a test for nvm install invalid behavior, and correcting the message.
From https://github.com/creationix/nvm/commit/f00d688c87873a9e3cffc1dbf54f63e0edd6e69b#commitcomment-6205164
This commit is contained in:
@@ -309,7 +309,7 @@ nvm() {
|
||||
[ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return
|
||||
|
||||
if [ "$VERSION" = "N/A" ]; then
|
||||
echo "Version '$VERSION' not found - try \`nvm ls-remote\` to browse available versions."
|
||||
echo "Version '$provided_version' not found - try \`nvm ls-remote\` to browse available versions."
|
||||
return 3
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
|
||||
. ../../nvm.sh
|
||||
[ "$(nvm install invalid.invalid)" = "Version 'invalid.invalid' not found - try \`nvm ls-remote\` to browse available versions." ] || die "nvm installing an invalid version did not print a nice error message"
|
||||
|
||||
Reference in New Issue
Block a user