mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-16 08:01:59 +01:00
Only use colored output if the terminal supports it
This also removes all the tput noise we are seeing in buildbot logs.
("tput: No value for $TERM and no -T specified", "tput: unknown terminal
"unknown", etc.)
BUG=none
TEST=manual below
src/platform/scripts$ TERM=unknown; ./enter_chroot (No more tput errors)
Change-Id: Ic74a0bd66d7e0cedcf7b65ec3a5f43b61b8276f9
Reviewed-on: http://gerrit.chromium.org/gerrit/4763
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
This commit is contained in:
parent
0fffd2bc75
commit
786ceeb389
19
common.sh
19
common.sh
@ -218,11 +218,20 @@ FACTORY_INSTALL_MASK="
|
|||||||
/usr/share/zoneinfo
|
/usr/share/zoneinfo
|
||||||
"
|
"
|
||||||
|
|
||||||
V_REVERSE="$(tput rev)"
|
# Determine and set up variables needed for fancy color output (if supported).
|
||||||
V_VIDOFF="$(tput sgr0)"
|
V_REVERSE=
|
||||||
V_BOLD_RED="$(tput bold; tput setaf 1)"
|
V_VIDOFF=
|
||||||
V_BOLD_GREEN="$(tput bold; tput setaf 2)"
|
V_BOLD_RED=
|
||||||
V_BOLD_YELLOW="$(tput bold; tput setaf 3)"
|
V_BOLD_GREEN=
|
||||||
|
V_BOLD_YELLOW=
|
||||||
|
|
||||||
|
if tput colors >/dev/null 2>&1; then
|
||||||
|
V_REVERSE="$(tput rev)"
|
||||||
|
V_VIDOFF="$(tput sgr0)"
|
||||||
|
V_BOLD_RED="$(tput bold; tput setaf 1)"
|
||||||
|
V_BOLD_GREEN="$(tput bold; tput setaf 2)"
|
||||||
|
V_BOLD_YELLOW="$(tput bold; tput setaf 3)"
|
||||||
|
fi
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Functions
|
# Functions
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user