Skip to content

Commit

Permalink
filter-doc-log.sh: don't use tput if TERM is not defined
Browse files Browse the repository at this point in the history
When running on jenkins and other automation environment, TERM will
not be defined and thus tput errors out.

Signed-off-by: Inaky Perez-Gonzalez <[email protected]>
  • Loading branch information
inaky-intc authored and Anas Nashif committed Dec 13, 2017
1 parent eb95d1c commit 22f22c2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions doc/scripts/filter-doc-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,27 @@ if [ -z "${LOG_FILE}" ]; then
exit 1
fi

# When running in background, detached from terminal jobs, tput will
# fail; we usually can tell because there is no TERM env variable.
if [ -z "${TERM:-}" ]; then
TPUT="true"
else
TPUT="tput"
fi

if [ -s "${LOG_FILE}" ]; then
$KI_SCRIPT --config-dir ${CONFIG_DIR} ${LOG_FILE} > doc.warnings 2>&1
if [ -s doc.warnings ]; then
echo
echo -e "${red}New errors/warnings found, please fix them:"
echo -e "=============================================="
tput sgr0
$TPUT sgr0
echo
cat doc.warnings
echo
else
echo -e "${green}No new errors/warnings."
tput sgr0
$TPUT sgr0
fi

else
Expand Down

0 comments on commit 22f22c2

Please sign in to comment.