Skip to content

Commit

Permalink
Comply to NO_COLOR env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
seven-beep committed Nov 20, 2024
1 parent 38d21aa commit 321f20e
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions update-motd.d/colors
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
NONE="\e[m"
export NONE

WHITE="\e[1;37m"
export WHITE
GREEN="\e[1;32m"
export GREEN
RED="\e[0;32;31m"
export RED
YELLOW="\e[1;33m"
export YELLOW
BLUE="\e[34m"
export BLUE
CYAN="\e[36m"
export CYAN
LIGHT_GREEN="\e[1;32m"
export LIGHT_GREEN
LIGHT_RED="\e[1;31m"
export LIGHT_RED
if [ "$NO_COLOR" -eq 1 ] ; then
export NONE=""
export WHITE=""
export GREEN=""
export RED=""
export YELLOW=""
export BLUE=""
export CYAN=""
export LIGHT_GREEN=""
export LIGHT_RED=""
else
export NONE="\e[m"
export WHITE="\e[1;37m"
export GREEN="\e[1;32m"
export RED="\e[0;32;31m"
export YELLOW="\e[1;33m"
export BLUE="\e[34m"
export CYAN="\e[36m"
export LIGHT_GREEN="\e[1;32m"
export LIGHT_RED="\e[1;31m"
fi

0 comments on commit 321f20e

Please sign in to comment.