From d54499f633199317c6d2ff580b801f9fc4d4f6f0 Mon Sep 17 00:00:00 2001 From: peb-adr Date: Tue, 18 Jan 2022 20:46:13 +0100 Subject: [PATCH] make services-to-main.sh more compatible (#6332) --- services-to-main.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/services-to-main.sh b/services-to-main.sh index 1cb108bc1..b8959b2f3 100755 --- a/services-to-main.sh +++ b/services-to-main.sh @@ -1,4 +1,6 @@ -# !/bin/bash +#!/bin/bash + +set -e function get_upstream_branch { local BRANCH_NAME=main @@ -18,10 +20,6 @@ function get_upstream_name { } function pull_latest_commit { - local SUBMODULE_NAME=$0 - echo "" - echo "$SUBMODULE_NAME" - local BRANCH_NAME=$(get_upstream_branch) local REMOTE_NAME=$(get_upstream_name) @@ -34,7 +32,14 @@ export -f pull_latest_commit export -f get_upstream_branch export -f get_upstream_name -git submodule foreach -q --recursive "bash -c pull_latest_commit \$name" +for mod in $(git submodule status | awk '{print $2}'); do + ( + echo "" + echo "$mod" + cd "$mod" + pull_latest_commit "$mod" + ) +done echo "" echo "Successfully updated all submodules to latest commit."