-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path3_pack.sh
executable file
·48 lines (47 loc) · 1.36 KB
/
3_pack.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
echo "##########################################"
echo "Building Extension"
cd ./angular
npm run build:prod
npx web-ext build -s ./dist -o
cd ./web-ext-artifacts/
echo "##########################################"
echo "FINDING LAST VERSION"
MAX_X=0
MAX_Y=0
MAX_Z=0
for FILE in `ls | grep .zip`
do
VERSION=`echo $FILE | sed -e "s/\.zip//" | sed -e "s/-chrome//" | sed -e "s/-ffx//" | cut -d- -f2`
X=`echo $VERSION | cut -d. -f1`
Y=`echo $VERSION | cut -d. -f2`
Z=`echo $VERSION | cut -d. -f3`
if [ $X -gt $MAX_X ]
then
MAX_X=$X
MAX_Y=$Y
MAX_Z=$Z
elif [ $X -eq $MAX_X ] && [ $Y -gt $MAX_Y ]
then
MAX_X=$X
MAX_Y=$Y
MAX_Z=$Z
elif [ $X -eq $MAX_X ] && [ $Y -eq $MAX_Y ] && [ $Z -gt $MAX_Z ]
then
MAX_X=$X
MAX_Y=$Y
MAX_Z=$Z
fi
done
VERSION="mist_extension-$MAX_X.$MAX_Y.$MAX_Z"
echo $VERSION
echo "##########################################"
echo "Unpacking ZIP"
rm -rf mist_extension
ZIP="$VERSION.zip"
unzip $ZIP -d mist_extension
echo "##########################################"
echo "Chrome packing..."
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --pack-extension=./mist_extension --pack-extension-key=mist_extension.pem
echo "##########################################"
echo "Updating Firefox source"
tar czvf mist_browser_extension.tar.gz mist_extension