From 606c8137a9a62e83cc73fcb06a70244f2e63a253 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Fri, 7 Jan 2022 03:14:50 +0100 Subject: [PATCH 1/2] Add forgotten parameter in recursive call --- deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index bf2e330..8b53c6a 100755 --- a/deploy.sh +++ b/deploy.sh @@ -27,7 +27,7 @@ currentbranch="$(git branch --format '%(refname:short)')" # If we are not on target branch, switch and run again if test "$currentbranch" '!=' "$branch"; then - exec /bin/sh -eu -c "git checkout $branch && exec $0" + exec /bin/sh -eu -c "git checkout $branch && exec $0 $branch" fi echo "Deploying branch $branch" From 167d7d6059cecdbf2ee1d21ee41304a06cff154c Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Fri, 7 Jan 2022 03:21:56 +0100 Subject: [PATCH 2/2] Use right command for determining current branch --- deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 8b53c6a..7667d99 100755 --- a/deploy.sh +++ b/deploy.sh @@ -23,7 +23,7 @@ fi # TODO: When deployment is new enough, use the top command. #currentbranch="$(git branch --show-current)" -currentbranch="$(git branch --format '%(refname:short)')" +currentbranch="$(git rev-parse --abbrev-ref HEAD)" # If we are not on target branch, switch and run again if test "$currentbranch" '!=' "$branch"; then