mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-11-22 20:01:26 +01:00
Respect NO_COLOR and CLICOLOR_FORCE (#2295)
http://bixense.com/clicolors/
This commit is contained in:
parent
8e2662fa65
commit
91c95bbf8f
2 changed files with 6 additions and 2 deletions
|
|
@ -100,8 +100,10 @@ sanitize() {
|
|||
}
|
||||
|
||||
colorize() {
|
||||
if [ -t 1 ]; then printf "\e[%sm%s\e[m" "$1" "$2"
|
||||
else echo -n "$2"
|
||||
if [[ -n $CLICOLOR_FORCE || ( -z $NO_COLOR && -t 1 ) ]]; then
|
||||
printf "\e[%sm%s\e[m" "$1" "$2"
|
||||
else
|
||||
printf "%s" "$2"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue