Commit 22f22c2f authored by Inaky Perez-Gonzalez's avatar Inaky Perez-Gonzalez Committed by Anas Nashif
Browse files

filter-doc-log.sh: don't use tput if TERM is not defined



When running on jenkins and other automation environment, TERM will
not be defined and thus tput errors out.

Signed-off-by: default avatarInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
parent eb95d1ce
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -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