Skip to content

Commit ff1257e

Browse files
committed
[Refactor] nvm_has_colors: also check the env var
1 parent 87a7097 commit ff1257e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nvm.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ nvm_has_colors() {
8383
if nvm_has tput; then
8484
NVM_NUM_COLORS="$(tput -T "${TERM:-vt100}" colors)"
8585
fi
86-
[ "${NVM_NUM_COLORS:--1}" -ge 8 ]
86+
[ "${NVM_NUM_COLORS:--1}" -ge 8 ] && [ "${NVM_NO_COLORS-}" != '--no-colors' ]
8787
}
8888

8989
nvm_curl_libz_support() {
@@ -1094,7 +1094,7 @@ nvm_print_formatted_alias() {
10941094
fi
10951095
local ARROW
10961096
ARROW='->'
1097-
if [ -z "${NVM_NO_COLORS}" ] && nvm_has_colors; then
1097+
if nvm_has_colors; then
10981098
ARROW='\033[0;90m->\033[0m'
10991099
if [ "_${DEFAULT}" = '_true' ]; then
11001100
NEWLINE=" \033[${DEFAULT_COLOR}(default)\033[0m\n"
@@ -1832,7 +1832,7 @@ nvm_print_versions() {
18321832
DEFAULT_COLOR=$(nvm_get_colors 5)
18331833
LTS_COLOR=$(nvm_get_colors 6)
18341834

1835-
if [ -z "${NVM_NO_COLORS-}" ] && nvm_has_colors; then
1835+
if nvm_has_colors; then
18361836
NVM_HAS_COLORS=1
18371837
fi
18381838

0 commit comments

Comments
 (0)