]> git.xonotic.org Git - xonotic/gmqcc.git/blob - misc/xonotic_export.sh
08f03550fca4cb43064215a4e0e58b93e47d5b6a
[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
24     git pull > /dev/null
25     echo "complete"
26 fi
27
28 echo -n "removing redundant files ... "
29 rm -f autocvarize.pl
30 rm -f autocvarize-update.sh
31 rm -f collect-precache.sh
32 rm -f fteqcc-bugs.qc
33 rm -f i18n-badwords.txt
34 rm -f i18n-guide.txt
35 rm -rf server-testcase
36 rm -f Makefile
37 rm -f *.src
38 echo "complete"
39
40 echo -n "creating zip archive ... "
41 zip -r -9 ../xonotic.zip * > /dev/null
42 echo "complete"
43
44 popd > /dev/null
45 echo "finished!"