do not look for pack to install in already installed pack
authorThomas Debesse <dev@illwieckz.net>
Sat, 14 Oct 2017 02:01:02 +0000 (04:01 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sat, 14 Oct 2017 21:28:58 +0000 (23:28 +0200)
Previously, the install-gamepacks.sh script was looking for all
subdirectories in games/ directory for *.games directory to
copy them inside games/ directory.

So, on first run,
it was looking for games/XonoticPack/xonotic.game
to copy it as games/xonotic.game

Then on second run,
it was looking for games/XonoticPack/xonotic.game
and also for games/xonotic.game/xonotic.game
which is silly.

Now the install-gamepacks.sh script is looking for games/*Pack
subdirectories only, it means all gamepacks must end with a
capitalized Pack suffix, which is already the case and is defined
in download-gamepacks.sh after all.

install-gamepacks.sh

index b42c59c..bc49364 100755 (executable)
@@ -20,8 +20,8 @@ case "$DOWNLOAD_GAMEPACKS" in
 esac
 
 set -e
-for GAME in games/*; do
-       if [ "$GAME" = "games/*" ]; then
+for GAME in games/*Pack; do
+       if [ "$GAME" = "games/*Pack" ]; then
                $ECHO "Game packs not found, please run"
                $ECHO "  $SOURCE_DIR/download-gamepacks.sh"
                $ECHO "and then try again!"