Skip to content

Commit

Permalink
Pull sub repos
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Sep 30, 2024
1 parent dd5dad5 commit 926931e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/include/vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def_var 'CFG_CUSTOM_BUILD_CMD' 'custom_build_cmd' "g++ main.c -o main" ''
def_var 'CFG_BAM_BIN' 'bam_bin' "bam" ''
def_var 'CFG_BAM_FLAGS' 'bam_flags' "server_release" ''
def_var 'CFG_GIT_PATCHES_DIR' 'git_patches_dir' "patches" ''

def_var 'CFG_PULL_GIT_SUB_REPOS' 'pull_git_sub_repos' "0" '(0|no|off|false|1|yes|on|true)'
20 changes: 20 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,25 @@ map_themes_post() {
popd > /dev/null || exit 1
fi
}
update_non_git_module_sub_repos() {
if ! is_cfg CFG_PULL_GIT_SUB_REPOS
then
return
fi

cd "$CFG_GIT_PATH_MOD" || exit 1
local sub_repo
while read -r sub_repo
do
[ -d "$sub_repo" ] || continue

log "found sub repo $sub_repo"
(
cd "$sub_repo" || exit 1
git_save_pull
)
done < <(find src -maxdepth 3 -name ".git" | rev | cut -c 5- | rev)
}
update_lua() {
[[ -d lua ]] || return
[[ -d lua/.git ]] || return
Expand Down Expand Up @@ -183,6 +202,7 @@ then
exit 0
fi
map_themes_pre
update_non_git_module_sub_repos
if [ "$CFG_BUILD_SYSTEM" == "cmake" ]
then
cmake_update_teeworlds "$@"
Expand Down

0 comments on commit 926931e

Please sign in to comment.