mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-06-27 11:38:43 +00:00
[Doc] Address symbolic link issue in the error message of nvm_die_on_prefix. Fixes #1385
This commit is contained in:
parent
1b2305232f
commit
abec1adc28
1
nvm.sh
1
nvm.sh
@ -2010,6 +2010,7 @@ nvm_die_on_prefix() {
|
||||
else
|
||||
nvm_err "Run \`$NVM_COMMAND\` to unset it."
|
||||
fi
|
||||
nvm_err "If \"$NVM_NPM_PREFIX\" is actually inside \"$NVM_DIR\" directory, please modify your NVM_DIR to make sure there is no any symbolic links."
|
||||
return 10
|
||||
fi
|
||||
fi
|
||||
|
@ -66,7 +66,8 @@ npm() {
|
||||
}
|
||||
OUTPUT="$(nvm_die_on_prefix 0 foo 2>&1)"
|
||||
EXPECTED_OUTPUT="nvm is not compatible with the npm config \"prefix\" option: currently set to \"./bad prefix\"
|
||||
Run \`npm config delete prefix\` or \`foo\` to unset it."
|
||||
Run \`npm config delete prefix\` or \`foo\` to unset it.
|
||||
If \"./bad prefix\" is actually inside \"$NVM_DIR\" directory, please modify your NVM_DIR to make sure there is no any symbolic links."
|
||||
EXIT_CODE="$(nvm_die_on_prefix 0 foo >/dev/null 2>&1; echo $?)"
|
||||
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "'nvm_die_on_prefix 0 foo' did not error with '$EXPECTED_OUTPUT' with bad prefix set; got '$OUTPUT'"
|
||||
[ "_$EXIT_CODE" = "_10" ] || die "'nvm_die_on_prefix 0 foo' did not exit with 10 with bad prefix set; got '$EXIT_CODE'"
|
||||
|
Loading…
Reference in New Issue
Block a user