Skip to content

Commit 72552cb

Browse files
committed
improved build script
1 parent bcd21e1 commit 72552cb

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

build.sh

+38-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ prepareChromeFunction()
2323
sed -i -e '28,32d;19d;35d' ./dev/manifest.json
2424
}
2525

26+
packageChromeFunction()
27+
{
28+
prepareChromeFunction
29+
echo "Creating archive for Chrome"
30+
cd ./dev/
31+
zip -qr chrome.zip ./*
32+
cd ..
33+
cp ./dev/chrome.zip ./build/
34+
echo "Archive created in ./build/"
35+
}
36+
2637
prepareFirefoxFunction()
2738
{
2839
echo "Preparing manifest.json for Firefox"
@@ -33,13 +44,27 @@ prepareFirefoxFunction()
3344
echo "Package for Firefox in ./dev/ created."
3445
}
3546

47+
packageFirefoxFunction()
48+
{
49+
prepareFirefoxFunction
50+
echo "Creating archive for Firefox"
51+
cp ./dev/firefox.zip ./build/
52+
}
53+
3654
prepareOperaFunction()
3755
{
3856
echo "Preparing manifest.json for Opera"
3957
echo "Right now it is the same as Chrome, going for it..."
4058
prepareChromeFunction
4159
}
4260

61+
packageOperaFunction()
62+
{
63+
prepareOperaFunction
64+
cp -rf ./dev/* ./build/
65+
echo "Use Opera and select the ./build/ directory and create a signed package."
66+
}
67+
4368
if [ -z "$1" ] || ([ "$1" != "dev" ] && [ "$1" != "package" ])
4469
then
4570
echo ""
@@ -70,7 +95,19 @@ fi
7095
if [ "$1" == "package" ]
7196
then
7297
mkdir -p ./build/
73-
echo "To be developed...."
98+
rm -rf ./build/*
99+
echo "Building package for $2"
100+
copyDevFunction
101+
if [ "$2" == "chrome" ]
102+
then
103+
packageChromeFunction
104+
elif [ "$2" == "opera" ]
105+
then
106+
packageOperaFunction
107+
else
108+
packageFirefoxFunction
109+
fi
110+
echo "Done, now publish package."
74111
fi
75112

76113
exit 0

0 commit comments

Comments
 (0)