-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.sh
executable file
·54 lines (41 loc) · 1.29 KB
/
build.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
49
50
51
52
53
54
#!/bin/bash
# gContactSync build script
# This script builds gContactSync into an xpi that may be installed in
# compatible applications (Thunderbird, Seamonkey, and Postbox).
#***Start editing here***
# NOTE: The VERSION here is just used for the package name
# Edit install.rdf and content/misc.js to change the actual VERSION
VERSION=3.2.0
SRC_DIR=./src
# Dest should be absolute or relative to SRC_DIR
DEST=$(pwd)/downloads/gContactSync-$VERSION.xpi
#***Stop editing here***
# Make sure the path to $DEST exists
if [ ! -d $(dirname $DEST) ]; then
echo "The path to $DEST does not exist, trying mkdir"
mkdir $(dirname $DEST)
if [ "$?" != 0 ]; then
exit 1
fi
fi
# remove the existing zip file
if [ -f $DEST ]; then
echo "Removing previous zip file at:"
echo $DEST
rm -f $DEST
fi
cd $SRC_DIR
# finds all files in locale/ excluding CVS directories and CVS files
LOCALE_FILES=$(find locale/ -maxdepth 2 -type f ! -name CVS ! -name Repository ! -name Root ! -name Entries)
# zip the source files
zip -r $DEST content/*.* defaults/preferences/*.* $LOCALE_FILES skin/*.* manifest.json chrome.manifest -x \*.sw\*
# quit if zip failed
if [ "$?" != 0 ]; then
echo "ERROR: zip failed, check '$DEST'"
exit 1
fi
echo "Package ready at:"
echo $DEST
echo "MD5 checksum:"
md5sum $DEST
git add $DEST