Improve uninstall error message for missing versions
Include the requested version in the uninstall error output when the target is not installed. Add a fast test to lock the behavior. Close #3767
This commit is contained in:
1 parent
6d761baef8
commit
5533699ec5
4 files changed
+38
-2
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
\. ../../nvm.sh
|
||||
\. ../common.sh
|
||||
|
||||
VERSION='v0.0.1'
|
||||
PATTERN='0.0'
|
||||
|
||||
mkdir -p "${NVM_DIR}/${VERSION}"
|
||||
|
||||
set +ex # needed for stderr
|
||||
RETURN_MESSAGE="$(nvm uninstall "${PATTERN}" 2>&1 || echo)"
|
||||
set -ex
|
||||
EXPECTED_MESSAGE="Version '${VERSION}' (inferred from ${PATTERN}) is not installed."
|
||||
|
||||
[ "${RETURN_MESSAGE}" = "${EXPECTED_MESSAGE}" ]
|
||||
Reference in new issue
Block a user