[Fix] nvm_print_versions: don't mark N/A as installed

With nothing installed, `nvm_ls` prints `N/A`, which then counted as an installed version,
so `nvm ls` and an unmatched `nvm ls-remote` printed `N/A *`.
This commit is contained in:
Jordan Harband committed 2026-10-21 13:52:16 -07:00
1 parent 6cef0edd18
commit fd23eb2037
3 files changed
+33 -2

No files matched your search

+1 -1
View File
@@ -2585,7 +2585,7 @@ nvm_print_versions() {
-v remote_versions="$(printf '%s' "${1-}" | tr '\n' '|')" \
-v latest_alias="${NVM_LATEST_ALIAS}" \
-v node_prefix="$(nvm_node_prefix)" -v iojs_prefix="$(nvm_iojs_prefix)" \
-v installed_versions="$(nvm_ls | tr '\n' '|')" -v current="$NVM_CURRENT" \
-v installed_versions="$(nvm_ls | nvm_grep -v '^N/A$' | tr '\n' '|')" -v current="$NVM_CURRENT" \
-v installed_color="$INSTALLED_COLOR" -v system_color="$SYSTEM_COLOR" \
-v current_color="$CURRENT_COLOR" -v default_color="$DEFAULT_COLOR" \
-v old_lts_color="$DEFAULT_COLOR" -v has_colors="$NVM_HAS_COLORS" \