summaryrefslogtreecommitdiff
path: root/update/createnew.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update/createnew.sh')
-rwxr-xr-xupdate/createnew.sh24
1 files changed, 17 insertions, 7 deletions
diff --git a/update/createnew.sh b/update/createnew.sh
index c0bb6fd..c29844f 100755
--- a/update/createnew.sh
+++ b/update/createnew.sh
@@ -4,22 +4,30 @@
# 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 +42,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