2014-02-08 20:13:14 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
in=assets/js/all.js
|
|
|
|
out=assets/js/all.min.js
|
|
|
|
|
2014-12-24 04:13:23 +01:00
|
|
|
rm -f $in 2>/dev/null
|
|
|
|
rm -f $out 2>/dev/null
|
|
|
|
|
2014-02-08 20:13:14 +01:00
|
|
|
cat assets/js/app.js assets/js/feed.js assets/js/item.js assets/js/event.js assets/js/nav.js > $in
|
|
|
|
echo "Miniflux.App.Run();" >> $in
|
|
|
|
|
2015-01-27 19:01:21 +01:00
|
|
|
output=$(curl -s \
|
|
|
|
-d compilation_level=ADVANCED_OPTIMIZATIONS \
|
|
|
|
-d output_format=text \
|
|
|
|
-d output_info=warnings \
|
|
|
|
-d output_info=errors \
|
|
|
|
-d warning_level=verbose \
|
|
|
|
-d output_file_name=all.min.js \
|
|
|
|
--data-urlencode "js_code@${in}" \
|
|
|
|
https://closure-compiler.appspot.com/compile)
|
|
|
|
|
|
|
|
if [ $(echo "$output" | wc -l) -gt 1 ]; then
|
|
|
|
echo -e "NOTHING DONE. There are issues:\n"
|
|
|
|
echo "$output"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
curl -s "https://closure-compiler.appspot.com/$output" -o "$out";
|
2014-02-08 20:13:14 +01:00
|
|
|
|
|
|
|
rm -f $in
|