-
-
Notifications
You must be signed in to change notification settings - Fork 381
/
make-eff-zip.sh
executable file
·44 lines (33 loc) · 1.12 KB
/
make-eff-zip.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
#!/usr/bin/env bash
# make a release zip for Chrome and Opera
#
# elsewhere, we make another zip for AMO Firefox (and Edge),
# as well as request a signed self-hosted XPI with `web-ext sign`,
# but we reuse the checkout folder when making the AMO zip
# and when requesting the self-hosted XPI, so any checkout folder
# changes below will make it to the Firefox/Edge packages
# this script takes a mandatory argument which is the git tag to build
if [ -n "$1" ]; then
SUBDIR=checkout
[ -d $SUBDIR ] && rm -rf $SUBDIR
mkdir $SUBDIR
cp -r -f -a .git $SUBDIR
cd $SUBDIR
git reset --hard "$1"
# clean up
rm -rf src/tests # remove unit tests
rm src/data/dnt-policy.txt # only used by unit tests
# include LICENSE in build
cp LICENSE src/
# disable debug output
sed -i -e 's/\.DEBUG = true/.DEBUG = false/' src/js/bootstrap.js
# blank out locale descriptions to reduce package size
../scripts/min_locales.py
else
echo "Please supply a tag name for the release you are zipping"
exit 1
fi
echo "Building zip version" "$1"
(cd src && zip -q -r ../privacy_badger-"$TARGET".zip .)
mv privacy_badger*.zip ../pkg/
cd -