friendica/bin/dev/minifyjs.sh

41 lines
724 B
Bash
Raw Permalink Normal View History

2013-01-31 21:05:27 -05:00
#!/bin/bash
command -v uglifyjs >/dev/null 2>&1 || { echo >&2 "I require UglifyJS but it's not installed. Aborting."; exit 1; }
2013-01-31 21:05:27 -05:00
MINIFY_CMD=uglifyjs
JSFILES=(
"view/js/ajaxupload.js"
"view/js/country.js"
"view/js/main.js"
"vendor/asset/base64/base64.min.js"
2013-01-31 21:05:27 -05:00
)
2013-02-04 20:16:13 -05:00
JSFILES2=(
"library/colorbox/jquery.colorbox.js"
)
2013-01-31 21:05:27 -05:00
for i in ${JSFILES[@]}
do
MINFILE=${i%%.js}.min.js
2013-02-04 20:16:13 -05:00
echo "Minifying $i into $MINFILE"
rm $MINFILE
$MINIFY_CMD -o $MINFILE $i
done
for i in ${JSFILES2[@]}
do
MINFILE=${i%%.js}-min.js
echo "Minifying $i into $MINFILE"
rm $MINFILE
$MINIFY_CMD -o $MINFILE $i
done
for i in ${JSFILES3[@]}
do
MINFILE=${i%%_src.js}.js
echo "Minifying $i into $MINFILE"
2013-01-31 21:05:27 -05:00
rm $MINFILE
$MINIFY_CMD -o $MINFILE $i
done