]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - install-gamepack.sh
separate out the process of installing a game pack into a .sh file, for later "adding...
[xonotic/netradiant.git] / install-gamepack.sh
diff --git a/install-gamepack.sh b/install-gamepack.sh
new file mode 100644 (file)
index 0000000..4073d40
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# installs a game pack
+# Usage:
+#   install-gamepack.sh gamepack installdir
+
+set -ex
+
+: ${CP:=cp}
+: ${CP_R:=cp -r}
+
+pack=$1
+dest=$2
+
+if [ -d "$pack/tools" ]; then
+       pack="$pack/tools"
+fi
+for GAMEFILE in "$pack/games"/*.game; do
+       $CP "$GAMEFILE" "$dest/games/"
+done
+for GAMEDIR in "$pack"/*.game/; do
+       $CP_R "$GAMEDIR" "$dest/"
+done