-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy
executable file
·60 lines (51 loc) · 1.72 KB
/
deploy
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
55
56
57
58
59
60
#!/usr/bin/env bash
if [ -f deploy.cfg ];
then
. deploy.cfg
else
echo "You need to create a 'deploy.cfg' file, based on deploy.cfg.template"
exit 2
fi
THE_POLY_HEAP="polychrome.polyml-heap"
#the directory of the extension
extension="$(dirname $0)"
cd "$extension"
extension=`pwd`
#update the extension file and move it to firefox profile
echo "$extension/polychrome" > [email protected]
rm -rf "$FIREFOX_PROFILE/extensions/[email protected]"
cp [email protected] "$FIREFOX_PROFILE/extensions/"
#remove these files to make firefox reregister the updated components
if [ -e "$FIREFOX_PROFILE/xpti.dat" ]; then rm "$FIREFOX_PROFILE/xpti.dat"; fi
if [ -e "$FIREFOX_PROFILE/compreg.dat" ]; then rm "$FIREFOX_PROFILE/compreg.dat"; fi
echo "PolyChrome deployed"
#if run is passed as a parameter run firefox
if [ "$1" == "run" ]
then
$FIREFOX_BINARY -jsconsole
else
echo "use argument 'run' to deploy and run Firefox"; echo "use argument 'package' to create an .xpi file"
fi
#if package is passed as a parameter create the xpi package
if [ "$1" == "package" ]
then
#remove the isaplib heap
isaplib_heap="$extension/polychrome/poly/isaplib/heaps/all.polyml-heap"
if [ -e "$isaplib_heap" ]; then
rm "$isaplib_heap";
fi
#remove the polyml heap
polyml_heap="$extension/polychrome/poly/bin/$THE_POLY_HEAP"
if [ -e "$polyml_heap" ]; then
rm "$polyml_heap"
fi
#remove the packaged extension
if [ -e polychrome.xpi ]; then
rm polychrome.xpi;
fi
ZIP=`which zip`
cd polychrome
${ZIP} -r ../polychrome.xpi *
cd ..
fi