mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-02-04 17:02:48 +08:00
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
19 lines
349 B
Bash
Executable File
19 lines
349 B
Bash
Executable File
#!/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}" ]
|