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
|
|
|
|
php ../maintenance/makeStaticLoader.php --section=head --ve-path=../modules/
|
2010-01-05 22:27:55 +00:00
|
|
|
elif [[ "$l" == "{{VE-LOAD-BODY}}" ]]
|
|
|
|
then
|
|
|
|
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
|
|
|
|
|
|
|
echo -e "$warnings"
|
|
|
|
|
|
|
|
# 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
|