[Fix] nvm_has_colors: also check if stdout is a terminal

This commit is contained in:
Jordan Harband
2026-01-26 23:31:00 -08:00
parent d2f93c1c8e
commit 35212c1346
17 changed files with 94 additions and 39 deletions

View File

@@ -39,7 +39,7 @@ nvm_version() {
}
OUTPUT="$(nvm_print_alias_path "$NVM_ALIAS_DIR" "$NVM_ALIAS_DIR/blah" | strip_colors)"
EXPECTED_OUTPUT='blah -> "blah" (-> v"blah")'
EXPECTED_OUTPUT='blah -> "blah" (-> v"blah" *)'
[ "$OUTPUT" = "$EXPECTED_OUTPUT" ] || die "'nvm_print_alias_path \"\$NVM_ALIAS_DIR\" \"\$NVM_ALIAS_DIR/blah\"' should strip alias dir and print nvm_alias output; got '$OUTPUT', expected '$EXPECTED_OUTPUT'"
cleanup