From 94620ee2daa8bfbc121a7de990f76c319c2489ed Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Thu, 2 Sep 2021 21:16:18 +0200 Subject: [PATCH] build_game.sh: separate vcs fetching from build-loop --- build_game.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build_game.sh b/build_game.sh index fa0f885b..7eb4fd5f 100755 --- a/build_game.sh +++ b/build_game.sh @@ -37,14 +37,16 @@ if [ -f "$SCRPATH"/bin/fteqcc ]; then export OLDDIR=$(pwd) cd ./src - make - cd "$OLDDIR" if [ "$BUILD_UPDATE" -eq 1 ]; then # git pull on the main repo git pull fi + make + cd "$OLDDIR" + + # update repos first in case there's dependencies find "$SCRPATH" -name Makefile | grep 'src\/Makefile' | grep -v engine | grep -v worldspawn | while read MFILE_N; do NEWDIR=$(dirname "$MFILE_N") cd "$NEWDIR" @@ -56,12 +58,19 @@ if [ -f "$SCRPATH"/bin/fteqcc ]; then set -e fi fi + cd $OLDDIR + done; + + # now loop through _again_ to build + find "$SCRPATH" -name Makefile | grep 'src\/Makefile' | grep -v engine | grep -v worldspawn | while read MFILE_N; do + NEWDIR=$(dirname "$MFILE_N") + cd "$NEWDIR" make cd .. export GAMEDIR=$(basename $PWD) cd $OLDDIR if [ -f "$SCRPATH"/bin/worldspawn ]; then - ./make_mapdef.sh $GAMEDIR + ./make_mapdef.sh $GAMEDIR fi done; else