2017-08-04 16:19:55 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# This script assumes a linux environment
|
|
|
|
|
2018-04-27 10:38:09 -06:00
|
|
|
echo "*** uBlock0.firefox: Creating web store package"
|
2017-08-04 16:19:55 -06:00
|
|
|
|
2018-12-23 16:19:16 -07:00
|
|
|
BLDIR=dist/build
|
|
|
|
DES="$BLDIR"/uBlock0.firefox
|
2017-08-04 16:19:55 -06:00
|
|
|
rm -rf $DES
|
|
|
|
mkdir -p $DES
|
|
|
|
|
2019-07-03 07:40:12 -06:00
|
|
|
echo "*** uBlock0.firefox: copying common files"
|
|
|
|
bash ./tools/copy-common-files.sh $DES
|
2017-08-04 16:19:55 -06:00
|
|
|
|
2017-08-29 16:32:00 -06:00
|
|
|
cp -R $DES/_locales/nb $DES/_locales/no
|
|
|
|
|
2018-04-27 10:38:09 -06:00
|
|
|
cp platform/firefox/manifest.json $DES/
|
|
|
|
cp platform/firefox/vapi-usercss.js $DES/js/
|
|
|
|
cp platform/firefox/vapi-webrequest.js $DES/js/
|
2017-08-04 16:19:55 -06:00
|
|
|
|
2018-04-27 10:38:09 -06:00
|
|
|
echo "*** uBlock0.firefox: concatenating content scripts"
|
2018-04-26 09:36:22 -06:00
|
|
|
cat $DES/js/vapi-usercss.js > /tmp/contentscript.js
|
|
|
|
echo >> /tmp/contentscript.js
|
|
|
|
grep -v "^'use strict';$" $DES/js/vapi-usercss.real.js >> /tmp/contentscript.js
|
2017-10-24 10:40:58 -06:00
|
|
|
echo >> /tmp/contentscript.js
|
|
|
|
grep -v "^'use strict';$" $DES/js/contentscript.js >> /tmp/contentscript.js
|
|
|
|
mv /tmp/contentscript.js $DES/js/contentscript.js
|
2018-04-26 09:36:22 -06:00
|
|
|
rm $DES/js/vapi-usercss.js
|
2018-04-12 10:17:38 -06:00
|
|
|
rm $DES/js/vapi-usercss.real.js
|
2018-04-26 09:36:22 -06:00
|
|
|
rm $DES/js/vapi-usercss.pseudo.js
|
2017-10-24 10:40:58 -06:00
|
|
|
|
2018-04-27 10:38:09 -06:00
|
|
|
# Firefox/webext-specific
|
2017-11-10 09:36:14 -07:00
|
|
|
rm $DES/img/icon_128.png
|
|
|
|
|
2018-04-27 10:38:09 -06:00
|
|
|
echo "*** uBlock0.firefox: Generating meta..."
|
|
|
|
python tools/make-firefox-meta.py $DES/
|
2017-08-04 16:19:55 -06:00
|
|
|
|
|
|
|
if [ "$1" = all ]; then
|
2018-04-27 10:38:09 -06:00
|
|
|
echo "*** uBlock0.firefox: Creating package..."
|
2017-08-04 16:19:55 -06:00
|
|
|
pushd $DES > /dev/null
|
|
|
|
zip ../$(basename $DES).xpi -qr *
|
|
|
|
popd > /dev/null
|
2018-12-23 08:16:08 -07:00
|
|
|
elif [ -n "$1" ]; then
|
|
|
|
echo "*** uBlock0.firefox: Creating versioned package..."
|
|
|
|
pushd $DES > /dev/null
|
2018-12-23 16:19:16 -07:00
|
|
|
zip ../$(basename $DES).xpi -qr *
|
2018-12-23 08:16:08 -07:00
|
|
|
popd > /dev/null
|
2018-12-23 16:19:16 -07:00
|
|
|
mv "$BLDIR"/uBlock0.firefox.xpi "$BLDIR"/uBlock0_"$1".firefox.xpi
|
2017-08-04 16:19:55 -06:00
|
|
|
fi
|
|
|
|
|
2018-04-27 10:38:09 -06:00
|
|
|
echo "*** uBlock0.firefox: Package done."
|