]> git.xonotic.org Git - xonotic/gmqcc.git/blob - misc/xonotic_export.sh
Merge branch 'master' into cooking
[xonotic/gmqcc.git] / misc / xonotic_export.sh
1 #!/bin/sh
2
3 if [ ! -d qcsrc ]; then
4     echo "failed to find qcsrc directory in $(pwd), please run this script"
5     echo "from xonotic-data.pk3dir"
6     exit 1
7 else
8     # ensure this is actually a xonotic repo
9     pushd qcsrc > /dev/null
10     if [ ! -d client -o ! -d common -o ! -d dpdefs -o ! -d menu -o ! -d server -o ! -d warpzonelib ]; then
11         echo "this doesnt look like a xonotic source tree, aborting"
12         popd > /dev/null
13         exit 1
14     fi
15 fi
16
17 # force reset and update
18 git rev-parse
19 if [ $? -ne 0 ]; then
20     echo "not a git directory, continuing without rebase"
21 else
22     echo -n "resetting git state and updating ... "
23     git reset --hard HEAD > /dev/null 2>&1
24     git pull > /dev/null 2>&1
25     echo "complete"
26 fi
27
28 echo -n "generate precache for csqc ..."
29 ./collect-precache.sh > /dev/null 2>&1
30 echo "complete"
31
32 echo -n "removing redundant files ..."
33 rm -f Makefile
34 rm -f autocvarize-update.sh
35 rm -f autocvarize.pl
36 rm -f collect-precache.sh
37 rm -f fteqcc-bugs.qc
38 rm -f i18n-badwords.txt
39 rm -f i18n-guide.txt
40 echo "complete"
41
42 echo -n "creating projects ..."
43 echo "client" >  dirs
44 echo "server" >> dirs
45 echo "menu"   >> dirs
46
47 echo "complete"
48
49 echo -n "creating zip archive ..."
50 zip -r -9 ../xonotic.zip * > /dev/null
51 echo "complete"
52
53 popd > /dev/null
54 echo "finished!"