From 41c6d20dca7d1188391a66566baf77df148ad525 Mon Sep 17 00:00:00 2001 From: nico wellpott Date: Tue, 8 Jun 2021 10:41:23 +0200 Subject: [PATCH] do not interrupt flow if repo is missing + add continue statements to skip iterations allows for a smoother workflow reducing the risk of a single typo interrupting a larger batch of repos in process --- svnmigrate.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/svnmigrate.sh b/svnmigrate.sh index 85ed6fa..53786cf 100644 --- a/svnmigrate.sh +++ b/svnmigrate.sh @@ -6,7 +6,7 @@ BASE_PATH="/home/user/nwellpott/svnMigration" function migrate() { # change dir /usr/bin/printf "changing directory to %s\n" "$REPO" - cd "$BASE_PATH/$REPO" || exit 1 + cd "$BASE_PATH/$REPO" || return 1 # rebase /usr/bin/printf "attempt to fetch %s commits\n" "$REPO" @@ -20,7 +20,7 @@ function clean() { function push() { # push changes - /usr/bin/git push --all + /usr/bin/git push --all || return 1 # push tags /usr/bin/git push --tags @@ -28,9 +28,9 @@ function push() { # main for REPO in "${REPOS[@]}"; do - migrate + migrate || continue clean - push + push || continue done