Skip to content

Commit

Permalink
Address linter warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
netomi committed Nov 8, 2023
1 parent 0a7cf07 commit 0dbfba8
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions tooling/common_logging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,30 @@

set -eu

export NORMAL=""
export BOLD=""
export RED=""
export YELLOW=""
NORMAL=""
BOLD=""
RED=""
YELLOW=""

# check if stdout is a terminal...
if test -t 1; then
# see if it supports colors...
ncolors=$(tput colors)

if test -n "$ncolors" && test "$ncolors" -ge 8; then
export NORMAL="$(tput sgr0)"
export BOLD="$(tput bold)"
export RED="$(tput setaf 1)"
export YELLOW="$(tput setaf 3)"
NORMAL="$(tput sgr0)"
BOLD="$(tput bold)"
RED="$(tput setaf 1)"
YELLOW="$(tput setaf 3)"
fi
fi

export NORMAL
export BOLD
export RED
export YELLOW


print_error() {
echo "${RED}ERROR:${NORMAL} $*" 1>&2;
}
Expand Down

0 comments on commit 0dbfba8

Please sign in to comment.