it's better to close file and return on non-void function
[xonotic/netradiant.git] / install-gamepacks.sh
index f4ae842..bc49364 100755 (executable)
@@ -4,27 +4,28 @@
 : ${SH:=sh}
 : ${CP:=cp}
 : ${CP_R:=cp -r}
+: ${SOURCE_DIR:=.}
 
 dest=$1
 
 case "$DOWNLOAD_GAMEPACKS" in
        yes)
-               LICENSEFILTER=GPL BATCH=1 $SH download-gamepacks.sh
+               LICENSEFILTER=GPL,BSD BATCH=1 $SH "$SOURCE_DIR/download-gamepacks.sh"
                ;;
        all)
-               BATCH=1 $SH download-gamepacks.sh
+               BATCH=1 $SH "$SOURCE_DIR/download-gamepacks.sh"
                ;;
        *)
                ;;
 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 "  ./download-gamepacks.sh"
+               $ECHO "  $SOURCE_DIR/download-gamepacks.sh"
                $ECHO "and then try again!"
        else
-               $SH install-gamepack.sh "$GAME" "$dest"
+               $SH "$SOURCE_DIR/install-gamepack.sh" "$GAME" "$dest"
        fi
 done