Callback: work at any arity
[xonotic/netradiant.git] / install-gamepacks.sh
1 #!/bin/sh
2
3 : ${ECHO:=echo}
4 : ${SH:=sh}
5 : ${CP:=cp}
6 : ${CP_R:=cp -r}
7 : ${SOURCE_DIR:=.}
8
9 dest=$1
10
11 case "$DOWNLOAD_GAMEPACKS" in
12         yes)
13                 LICENSEFILTER=GPL,BSD BATCH=1 $SH "$SOURCE_DIR/download-gamepacks.sh"
14                 ;;
15         all)
16                 BATCH=1 $SH "$SOURCE_DIR/download-gamepacks.sh"
17                 ;;
18         *)
19                 ;;
20 esac
21
22 set -e
23 for GAME in games/*Pack; do
24         if [ "$GAME" = "games/*Pack" ]; then
25                 $ECHO "Game packs not found, please run"
26                 $ECHO "  $SOURCE_DIR/download-gamepacks.sh"
27                 $ECHO "and then try again!"
28         else
29                 $SH "$SOURCE_DIR/install-gamepack.sh" "$GAME" "$dest"
30         fi
31 done