2021-07-31 12:49:32 -06:00
|
|
|
#!/usr/bin/env bash
|
2017-08-04 16:19:55 -06:00
|
|
|
#
|
|
|
|
# This script assumes a linux environment
|
|
|
|
|
2021-07-31 15:34:25 -06:00
|
|
|
set -e
|
|
|
|
|
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
|
|
|
|
|
2021-07-16 08:06:58 -06:00
|
|
|
echo "*** uBlock0.firefox: Copying common files"
|
2019-07-03 07:40:12 -06:00
|
|
|
bash ./tools/copy-common-files.sh $DES
|
2017-08-04 16:19:55 -06:00
|
|
|
|
2021-07-16 08:06:58 -06:00
|
|
|
# Firefox-specific
|
|
|
|
echo "*** uBlock0.firefox: Copying firefox-specific files"
|
2021-07-25 08:55:35 -06:00
|
|
|
cp platform/firefox/*.json $DES/
|
|
|
|
cp platform/firefox/*.js $DES/js/
|
2017-08-29 16:32:00 -06:00
|
|
|
|
2021-07-16 08:06:58 -06:00
|
|
|
# Firefox store-specific
|
2021-07-25 08:55:35 -06:00
|
|
|
cp -R $DES/_locales/nb $DES/_locales/no
|
2017-08-04 16:19:55 -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."
|