]> git.xonotic.org Git - xonotic/gmqcc.git/blob - misc/xonotic_export.sh
075b044aa491be45314b22e2006f4ed147880a1e
[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 "removing redundant files ..."
29 rm -f Makefile
30 rm -f autocvarize-update.sh
31 rm -f autocvarize.pl
32 rm -f collect-precache.sh
33 rm -f fteqcc-bugs.qc
34 rm -f i18n-badwords.txt
35 rm -f i18n-guide.txt
36 echo "complete"
37
38 echo -n "creating projects ..."
39 echo "client" >  dirs
40 echo "server" >> dirs
41 echo "menu"   >> dirs
42
43 echo "complete"
44
45 echo -n "creating zip archive ..."
46 zip -r -9 ../xonotic.zip * > /dev/null
47 echo "complete"
48
49 popd > /dev/null
50 echo "finished!"