From 8c7bc9c2b291afbeb9b80b7b6ea47f0f9321d827 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 16 Apr 2024 08:32:30 +0000 Subject: [PATCH] Debug output for add_sub_repos --- make_help_scripts/add_sub_repos | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/make_help_scripts/add_sub_repos b/make_help_scripts/add_sub_repos index 99b548e473e..643b5f0136c 100755 --- a/make_help_scripts/add_sub_repos +++ b/make_help_scripts/add_sub_repos @@ -9,9 +9,18 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi add_sub_repositories () { # checkout a base for defined starting point cd "$base_dir" || { echo "Could not checkout base dir of control.ros.org. Exiting!"; exit "$ERRCODE"; } - for repo_name in "${!subrepo_url[@]}"; - do echo "Create doc/$repo_name" - git clone "${subrepo_url[$repo_name]}" -b "$base_branch" doc/"$repo_name" + for repo_name in "${!subrepo_url[@]}"; do + if [ ! -d "doc/$repo_name" ]; then + echo "Create doc/$repo_name and checkout $base_branch branch" + git clone "${subrepo_url[$repo_name]}" -b "$base_branch" doc/"$repo_name" + else + echo "Update doc/$repo_name and checkout $base_branch branch" + cd doc/"$repo_name" + git fetch origin + git checkout "$base_branch" + git pull + cd "$base_dir" + fi if [ ! -z ${subrepo_pr[$repo_name]} ]; then echo "checkout PR: ${subrepo_pr[$repo_name]}" cd doc/"$repo_name"