Skip to content

Commit

Permalink
use LTS_COLOR instead of DEFAULT_COLOR for old LTS
Browse files Browse the repository at this point in the history
Signed-off-by: ryenus <ryenus@gmail.com>
  • Loading branch information
ryenus committed Jun 6, 2022
1 parent 88cde8b commit ddddd6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,7 @@ nvm_print_versions() {
CURRENT_COLOR=$(nvm_get_colors 3)
NOT_INSTALLED_COLOR=$(nvm_get_colors 4)
DEFAULT_COLOR=$(nvm_get_colors 5)
LTS_COLOR=$(nvm_get_colors 6)

if [ -z "${NVM_NO_COLORS-}" ] && nvm_has_colors; then
NVM_HAS_COLORS=1
Expand All @@ -1664,7 +1665,7 @@ nvm_print_versions() {
awk -v _input="${1-}" -v _nvm_ls="$(nvm_ls)" -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 has_colors="$NVM_HAS_COLORS" '
-v old_lts_color="$LTS_COLOR" -v has_colors="$NVM_HAS_COLORS" '
BEGIN {
fmt_installed = has_colors ? ("\033[" installed_color "%15s\033[0m") : "%15s";
fmt_system = has_colors ? ("\033[" system_color "%15s\033[0m") : "%15s";
Expand All @@ -1673,7 +1674,7 @@ BEGIN {
latest_lts_color = current_color;
sub(/0;/, "1;", latest_lts_color);
fmt_latest_lts = has_colors ? ("\033[" latest_lts_color "(Latest LTS: %s)\033[0m") : "(Latest LTS: %s)";
fmt_old_lts = has_colors ? ("\033[" default_color "(LTS: %s)\033[0m") : "(LTS: %s)";
fmt_old_lts = has_colors ? ("\033[" old_lts_color "(LTS: %s)\033[0m") : "(LTS: %s)";
fmt_aux[1] = " ";
fmt_aux[2] = " * ";
Expand Down

0 comments on commit ddddd6e

Please sign in to comment.