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