mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-02-14 21:53:05 +08:00
[Fix] nvm_has_colors: also check if stdout is a terminal
This commit is contained in:
@@ -15,11 +15,11 @@ fi
|
||||
nvm alias test-stable-1 0.0.2 || die '`nvm alias test-stable-1 0.0.2` failed'
|
||||
|
||||
OUTPUT="$(nvm alias test-stable-1 | strip_colors)"
|
||||
EXPECTED_OUTPUT='test-stable-1 -> 0.0.2 (-> v0.0.2)'
|
||||
EXPECTED_OUTPUT='test-stable-1 -> 0.0.2 (-> v0.0.2 *)'
|
||||
echo "$OUTPUT" | \grep -F "$EXPECTED_OUTPUT" || die "nvm alias test-stable-1 0.0.2 did not set test-stable-1 to 0.0.2: got '$OUTPUT'"
|
||||
|
||||
nvm alias test-stable-1 0.0.1 || die '`nvm alias test-stable-1 0.0.1` failed'
|
||||
|
||||
OUTPUT="$(nvm alias test-stable-1 | strip_colors)"
|
||||
EXPECTED_OUTPUT='test-stable-1 -> 0.0.1 (-> v0.0.1)'
|
||||
EXPECTED_OUTPUT='test-stable-1 -> 0.0.1 (-> v0.0.1 *)'
|
||||
echo "$OUTPUT" | \grep -F "$EXPECTED_OUTPUT" || die "nvm alias test-stable-1 0.0.1 did not set test-stable-1 to 0.0.1: got '$OUTPUT'"
|
||||
|
||||
Reference in New Issue
Block a user