2013-02-09 01:33:48 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
cd $(cd $(dirname $0); pwd)
|
|
|
|
|
|
|
|
(
|
|
|
|
while IFS='' read -r l
|
|
|
|
do
|
2010-01-05 22:27:55 +00:00
|
|
|
if [[ "$l" == "{{VE-LOAD-HEAD}}" ]]
|
2013-02-09 01:33:48 +00:00
|
|
|
then
|
2013-03-28 19:31:28 +00:00
|
|
|
php ../maintenance/makeStaticLoader.php --section=head --ve-path=../modules/ $*
|
2010-01-05 22:27:55 +00:00
|
|
|
elif [[ "$l" == "{{VE-LOAD-BODY}}" ]]
|
|
|
|
then
|
2013-03-28 19:31:28 +00:00
|
|
|
php ../maintenance/makeStaticLoader.php --section=body --ve-path=../modules/ $*
|
2013-02-09 01:33:48 +00:00
|
|
|
else
|
|
|
|
echo "$l"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
) < eg-iframe.tpl | php > eg-iframe.html
|
|
|
|
|
2013-03-20 16:45:57 +00:00
|
|
|
warnings=`jsduck --config=config.json 2>&1`
|
|
|
|
ec=$?
|
|
|
|
|
2013-02-09 01:33:48 +00:00
|
|
|
rm eg-iframe.html
|
|
|
|
cd - > /dev/null
|
2013-03-20 16:45:57 +00:00
|
|
|
|
2013-03-28 18:55:25 +00:00
|
|
|
# Re-colorize
|
|
|
|
NORMAL=$(tput sgr0); YELLOW=$(tput setaf 3); MEGANTA=$(tput setaf 5)
|
|
|
|
echo "$warnings" | perl -pe "s|^([^ ]+) ([^ ]+) (.*)$|${YELLOW}\1 ${MEGANTA}\2${NORMAL} \3|"
|
2013-03-20 16:45:57 +00:00
|
|
|
|
|
|
|
# JSDuck doesn't exit with an error code if there are warnings
|
|
|
|
# (only when there are fatal errors). We fixed all warnings
|
|
|
|
# in master so lets consider all warnings errors to ensure
|
|
|
|
# we don't introduce any new invalid jsduck syntax.
|
|
|
|
if [[ "$ec" == "0" && "$warnings" != "" ]]
|
|
|
|
then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-03-15 16:25:39 +00:00
|
|
|
# Exit with exit code of jsduck command
|
|
|
|
exit $ec
|