summaryrefslogtreecommitdiff
path: root/update/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update/update.sh')
-rwxr-xr-xupdate/update.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/update/update.sh b/update/update.sh
index c0bb6fd..aab3415 100755
--- a/update/update.sh
+++ b/update/update.sh
@@ -4,22 +4,29 @@
# Author: Andrei Karas (4144)
dir=`pwd`
-#CC=${CC:=gcc}
+tmp_path=$PATH
-#rm adler32
-#$CC -lz adler32.c -o adler32
+export PATH="$dir:$PATH"
-mkdir -p files
-mkdir -p upload
+if [[ ! -d "files" ]]; then
+ mkdir -p files
+fi
+
+if [[ ! -d "upload" ]]; then
+ mkdir -p upload
+fi
+
+if [[ -f files/themanaworld.zip ]]; then
+ rm files/themanaworld.zip
+fi
-rm files/themanaworld.zip
cd ../../client-data
find -iregex ".+[.]\(xml\|png\|tmx\|ogg\|txt\|po\|tsx\)" -exec touch --date=2015-01-01 {} \;
find -iregex ".+[.]\(xml\|png\|tmx\|ogg\|txt\|po\|tsx\)" -printf "%P\n" | zip -X -@ ../tools/update/files/themanaworld.zip
git log --pretty=oneline -n 1 | awk '{print $1}' >../tools/update/commit.txt
cd $dir/files
-sum=`adler32 themanaworld.zip | awk '{print $2}'`
+sum=`adler32 1 themanaworld.zip`
echo "themanaworld.zip ${sum}" >resources2.txt
echo '<?xml version="1.0"?>
@@ -34,3 +41,5 @@ cp themanaworld.zip ../upload/
cp resources2.txt ../upload/
cp resources.xml ../upload/
cp ../news.txt ../upload/
+
+export PATH="$tmp_path" \ No newline at end of file