forked from dhowe/AdNauseam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-firefox.sh
executable file
·48 lines (36 loc) · 1.33 KB
/
make-firefox.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
#
# This script assumes a linux environment
echo "*** AdNauseam.firefox: Creating web store package"
BLDIR=dist/build
DES="$BLDIR"/adnauseam.firefox
rm -rf $DES
mkdir -p $DES/webextension
VERSION=`jq .version manifest.json` # top-level adnauseam manifest
echo "*** AdNauseam.firefox: Copying common files"
bash ./tools/copy-common-files.sh $DES
# Firefox-specific
echo "*** AdNauseam.firefox: Copying firefox-specific files"
cp platform/firefox/*.json $DES/
cp platform/firefox/*.js $DES/js/
# Firefox store-specific
cp -R $DES/_locales/nb $DES/_locales/no
# Webext-specific
rm $DES/img/icon_128.png
awk -v s=$VERSION '{gsub(/"{version}"/, s)}1' $DES/manifest.json > /tmp/manifest.json && mv /tmp/manifest.json $DES/manifest.json
echo "*** AdNauseam.firefox: Generating meta..."
python3 tools/make-firefox-meta.py $DES/
if [ "$1" = all ]; then
echo "*** AdNauseam.firefox: Creating package..."
pushd $(dirname $DES/) > /dev/null
zip adnauseam.firefox.zip -qr $(basename $DES/)/*
popd > /dev/null
elif [ -n "$1" ]; then
echo "*** AdNauseam.firefox: Creating versioned package..."
pushd $DES > /dev/null
zip ../$(basename $DES).xpi -qr *
popd > /dev/null
mv "$BLDIR"/uBlock0.firefox.xpi "$BLDIR"/uBlock0_"$1".firefox.xpi
fi
echo "*** AdNauseam.firefox: Package done."
echo