Docgen: Re-colourise jsduck warnings.

When jsduck is executed in a subshell (as we do, to catch output)
it disables the color output. It should have a --color flag, but
it doesn't have that, so manually colourise for now.

Change-Id: I1f8da523b6b4fc1fc6965f751395f8af497b13b5
This commit is contained in:
Timo Tijhof 2013-03-28 19:55:25 +01:00
parent e47ed7309b
commit 36fb75d6b1

View file

@ -22,7 +22,9 @@ ec=$?
rm eg-iframe.html rm eg-iframe.html
cd - > /dev/null cd - > /dev/null
echo -e "$warnings" # Re-colorize
NORMAL=$(tput sgr0); YELLOW=$(tput setaf 3); MEGANTA=$(tput setaf 5)
echo "$warnings" | perl -pe "s|^([^ ]+) ([^ ]+) (.*)$|${YELLOW}\1 ${MEGANTA}\2${NORMAL} \3|"
# JSDuck doesn't exit with an error code if there are warnings # JSDuck doesn't exit with an error code if there are warnings
# (only when there are fatal errors). We fixed all warnings # (only when there are fatal errors). We fixed all warnings