2021-07-31 20:49:32 +02:00
|
|
|
#!/usr/bin/env bash
|
2017-08-05 00:19:55 +02:00
|
|
|
#
|
|
|
|
# This script assumes a linux environment
|
|
|
|
|
2021-07-31 23:34:25 +02:00
|
|
|
set -e
|
|
|
|
|
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
|
|
|
mkdir -p $DES
|
2024-03-05 13:59:11 +01:00
|
|
|
rm -rf $DES/*
|
2017-08-05 00:19:55 +02:00
|
|
|
|
2021-07-16 16:06:58 +02:00
|
|
|
echo "*** uBlock0.firefox: Copying common files"
|
2023-05-05 01:20:18 +02:00
|
|
|
bash ./tools/copy-common-files.sh $DES
|
2017-08-05 00:19:55 +02:00
|
|
|
|
2021-07-16 16:06:58 +02:00
|
|
|
# Firefox-specific
|
|
|
|
echo "*** uBlock0.firefox: Copying firefox-specific files"
|
2021-07-25 16:55:35 +02:00
|
|
|
cp platform/firefox/*.json $DES/
|
|
|
|
cp platform/firefox/*.js $DES/js/
|
2017-08-30 00:32:00 +02:00
|
|
|
|
2021-07-16 16:06:58 +02:00
|
|
|
# Firefox store-specific
|
2021-07-25 16:55:35 +02:00
|
|
|
cp -R $DES/_locales/nb $DES/_locales/no
|
2017-08-05 00:19:55 +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..."
|
2021-08-25 10:47:45 +02:00
|
|
|
python3 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."
|