forked from GER-Space/Kerbal-Konstructs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_zip.sh
39 lines (22 loc) · 980 Bytes
/
create_zip.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
#/usr/bin/bash
#
#
cd /c/Git/Kerbal-Konstructs
VERSION=`grep -i AssemblyFileVersion src/Properties/AssemblyInfo.cs | cut -d "\"" -f 2`
MAJOR=`echo ${VERSION} | cut -d "." -f 1 `
MINOR=`echo ${VERSION} | cut -d "." -f 2 `
PATCH=`echo ${VERSION} | cut -d "." -f 3 `
BUILD=`echo ${VERSION} | cut -d "." -f 4 `
if (test $1 != "") ; then
VERSION=${VERSION}_$1
fi
FILENAME="Kerbal-Konstructs-${VERSION}.zip"
if test -e $FILENAME ; then
rm -f Kerbal-Konstructs-${VERSION}.zip
fi
sed -i "s/MAJOR\":./MAJOR\":$MAJOR/" GameData/KerbalKonstructs/KerbalKonstructs.version
sed -i "s/MINOR\":./MINOR\":$MINOR/" GameData/KerbalKonstructs/KerbalKonstructs.version
sed -i "s/PATCH\":./PATCH\":$PATCH/" GameData/KerbalKonstructs/KerbalKonstructs.version
sed -i "s/BUILD\":.*/BUILD\":$BUILD/" GameData/KerbalKonstructs/KerbalKonstructs.version
cp -r /c/Git/CustomPreLaunchChecks/GameData/CustomPreLaunchChecks/ GameData
/c/Program\ Files/7-Zip/7z.exe a -r $FILENAME GameData