mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-07 21:17:53 +00:00
[Fix] nvm ls
/nvm alias
/nvm_list_aliases
: zsh: when no LTS aliases, no error
Fixes #2575.
This commit is contained in:
21
test/fast/Aliases/nvm_list_aliases works with no LTS aliases present
Executable file
21
test/fast/Aliases/nvm_list_aliases works with no LTS aliases present
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
\. ../../../nvm.sh
|
||||
|
||||
die () {
|
||||
mv "$(nvm_alias_path)/_lts.bak" "$(nvm_alias_path)/lts"
|
||||
echo "$@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -e
|
||||
|
||||
nvm_alias_path() {
|
||||
nvm_echo "../../../alias"
|
||||
}
|
||||
|
||||
mv "$(nvm_alias_path)/lts" "$(nvm_alias_path)/_lts.bak"
|
||||
|
||||
STDERR_OUTPUT="$(nvm_list_aliases 2>&1 >/dev/null)"
|
||||
|
||||
[ -z "${STDERR_OUTPUT}" ] || die "expected no stderr output, got >${STDERR_OUTPUT}<"
|
Reference in New Issue
Block a user