-
Notifications
You must be signed in to change notification settings - Fork 17
/
make_xpi.sh
executable file
·26 lines (19 loc) · 908 Bytes
/
make_xpi.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
#!/bin/bash
# version with "v" v2.0.0
VVERSION=$(git describe --tags)
# version without v: 2.0.0
VERSION=$(echo $VVERSION | sed s/v//)
# create a backup
cp manifest.json manifest.json_backup
# release version
sed -i "s/_VERSION_WILL_BE_FILLED_BY_MAKE_XPI_SCRIPT_/${VERSION}/g" manifest.json
zip -FS -r correct_identity_${VVERSION}.xpi LICENSE *.html scripts _locales icons schema.json manifest.json
# revert to backup
cp manifest.json_backup manifest.json
# development version without "strict_max_version"
sed -i "s/_VERSION_WILL_BE_FILLED_BY_MAKE_XPI_SCRIPT_/${VERSION}_dev/g" manifest.json
sed -i "s/\(\"strict_min_version\":[^,]*\),/\1/g;s/\"strict_max_version\":/\/\/ \"strict_max_version\":/g" manifest.json
zip -FS -r correct_identity_${VVERSION}_dev.xpi LICENSE *.html scripts _locales schema.json manifest.json
# revert to backup
cp manifest.json_backup manifest.json
rm manifest.json_backup