2013-02-01 02:05:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-08-25 06:45:08 +00:00
|
|
|
# SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2013-05-04 00:17:56 +00:00
|
|
|
command -v uglifyjs >/dev/null 2>&1 || { echo >&2 "I require UglifyJS but it's not installed. Aborting."; exit 1; }
|
|
|
|
|
2013-02-01 02:05:27 +00:00
|
|
|
MINIFY_CMD=uglifyjs
|
|
|
|
|
|
|
|
JSFILES=(
|
2018-01-28 21:17:36 +00:00
|
|
|
"view/js/ajaxupload.js"
|
|
|
|
"view/js/country.js"
|
|
|
|
"view/js/main.js"
|
2018-01-18 02:23:51 +00:00
|
|
|
"vendor/asset/base64/base64.min.js"
|
2013-02-01 02:05:27 +00:00
|
|
|
)
|
2013-02-05 01:16:13 +00:00
|
|
|
JSFILES2=(
|
|
|
|
"library/colorbox/jquery.colorbox.js"
|
|
|
|
)
|
2013-02-01 02:05:27 +00:00
|
|
|
|
|
|
|
for i in ${JSFILES[@]}
|
|
|
|
do
|
|
|
|
MINFILE=${i%%.js}.min.js
|
2013-02-05 01:16:13 +00: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-02-01 02:05:27 +00:00
|
|
|
rm $MINFILE
|
|
|
|
$MINIFY_CMD -o $MINFILE $i
|
|
|
|
done
|
|
|
|
|