File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -Eexuo pipefail # abort the script on error
3
3
4
+ # Array to collect errors
5
+ declare -a errors
6
+
4
7
# replicate shared data from this repo into all repositories at Ory
5
8
function replicate_all {
6
9
# verify arguments
@@ -119,6 +122,15 @@ function replicate_all {
119
122
repo_type=${type_map[$repo_name]:- library}
120
123
replicate " ory/$repo_name " " $repo_type " " $human_name " " $workspace " " $persist "
121
124
done
125
+
126
+ # Check for errors and exit with a non-zero status if any errors were collected
127
+ if [ ${# errors[@]} -ne 0 ]; then
128
+ echo " Errors occurred during git push:"
129
+ for error in " ${errors[@]} " ; do
130
+ echo " $error "
131
+ done
132
+ exit 1
133
+ fi
122
134
}
123
135
124
136
# replicates the info in this repository into the given target repository
@@ -304,7 +316,9 @@ function push_changes {
304
316
local -r repo_path=$1
305
317
(
306
318
cd " $repo_path "
307
- git push
319
+ if ! git push; then
320
+ errors+=(" Failed to push changes for $repo_path " )
321
+ fi
308
322
)
309
323
}
310
324
You can’t perform that action at this time.
0 commit comments