mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-02-05 09:22:50 +08:00
[patch] show system Node.js version in nvm ls
Normalize `nvm_version` output when `nvm_ls` returns "system vX" so alias and .nvmrc resolutions treat system correctly. Add fast tests for system alias behavior in `nvm ls`, `nvm use`, and `nvm which`.
This commit is contained in:
committed by
Jordan Harband
parent
b1dd81097f
commit
29a652f90f
@@ -34,6 +34,9 @@ nvm_ls() {
|
||||
[ "_$(nvm_version node)" = "_pattern: stable" ] || die '"nvm_version node" did not pass "stable" to "nvm_ls"'
|
||||
[ "_$(nvm_version node-)" = "_pattern: stable" ] || die '"nvm_version node-" did not pass "stable" to "nvm_ls"'
|
||||
|
||||
nvm_ls() { echo "system v20.0.0"; }
|
||||
[ "_$(nvm_version system)" = "_system" ] || die '"nvm_version system" did not return "system" when "nvm_ls" returns extra columns'
|
||||
|
||||
nvm_ls() { echo "N/A"; }
|
||||
OUTPUT="$(nvm_version foo)"
|
||||
EXPECTED_OUTPUT="N/A"
|
||||
|
||||
Reference in New Issue
Block a user