-
Notifications
You must be signed in to change notification settings - Fork 3
/
create_zip.sh
37 lines (22 loc) · 903 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
#
#
PROJECTNAME=AdvancedTextures
cd /c/Git/${PROJECTNAME}
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="${PROJECTNAME}-${VERSION}.zip"
if test -e $FILENAME ; then
rm -f ${PROJECTNAME}-${VERSION}.zip
fi
sed -i "s/MAJOR\":./MAJOR\":$MAJOR/" GameData/${PROJECTNAME}/${PROJECTNAME}.version
sed -i "s/MINOR\":./MINOR\":$MINOR/" GameData/${PROJECTNAME}/${PROJECTNAME}.version
sed -i "s/PATCH\":./PATCH\":$PATCH/" GameData/${PROJECTNAME}/${PROJECTNAME}.version
sed -i "s/BUILD\":.*/BUILD\":$BUILD/" GameData/${PROJECTNAME}/${PROJECTNAME}.version
/c/Program\ Files/7-Zip/7z.exe a -r $FILENAME GameData