-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmake.sh
executable file
·45 lines (37 loc) · 861 Bytes
/
make.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
#!/bin/bash
#
# Packages the ThunderBirthDay add-on in a xpi-file.
# Entries from .gitignore are ignored.
#
# Usage: ./make.sh
#
ROOTDIR="$(pushd `dirname $0` > /dev/null; pwd; popd > /dev/null)"
# Find install.rdf
SRCDIR="$ROOTDIR/src"
if [ ! -e "$SRCDIR/install.rdf" ]
then
echo "install.rdf not found. Exiting..."
exit
fi
# Find version
VERSION=$(grep em:version "$SRCDIR/install.rdf" | sed "s/.*<em:version>//" | sed "s/<\/.*//")
if [[ -z "$VERSION" ]]
then
echo "version number not found. Exiting..."
exit
fi
# Find output directory
GENDIR="$ROOTDIR/gen"
if [ ! -d "$GENDIR" ]
then
echo "gen directory not found. Exiting..."
exit
fi
# Remove old XPI
XPIFILE="$GENDIR/thunderbirthday-$VERSION.xpi"
rm -f "$XPIFILE"
# Create XPI
cd "$SRCDIR"
zip -r "$XPIFILE" . -x@"$ROOTDIR/.gitignore"
cd "$ROOTDIR"
zip "$XPIFILE" README.md