From a390ef03293d70945800a3fecbe5041ebfed03d9 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Sun, 20 Nov 2022 04:40:03 +0100 Subject: [PATCH] =?UTF-8?q?make/lib:=20safe=5Fcheckout=5Fbranch=20sta?= =?UTF-8?q?=C4=8D=C3=AD=201=20parametr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- make/deploy | 2 +- make/deploy_prod | 2 +- make/lib.sh | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/make/deploy b/make/deploy index 4e93d5e1..24ade165 100755 --- a/make/deploy +++ b/make/deploy @@ -9,7 +9,7 @@ only_in_directory "$TESTWEB" CURRENT_BRANCH="$(git branch --show-current)" BRANCH="${1:-$CURRENT_BRANCH}" -safe_checkout_branch "$BRANCH" "$0" +safe_checkout_branch "$BRANCH" # Teď máme správnou větev, jdeme vše nainstalovat install_everything diff --git a/make/deploy_prod b/make/deploy_prod index 0c10219d..ec3110c6 100755 --- a/make/deploy_prod +++ b/make/deploy_prod @@ -18,7 +18,7 @@ fi # Záloha DB ( cd -P .. && ./backup_prod_db.sh ) -safe_checkout_branch "$BRANCH" "$0" +safe_checkout_branch "$BRANCH" # Teď máme správnou větev, jdeme vše nainstalovat install_everything diff --git a/make/lib.sh b/make/lib.sh index 7df79d82..581252cf 100644 --- a/make/lib.sh +++ b/make/lib.sh @@ -48,14 +48,12 @@ function only_in_directory { function safe_checkout_branch { if "$#" -ne 2 then - echo >&2 "Použití: $0 " + echo >&2 "Použití: $0 " return 1 fi local BRANCH="$1" - local SCRIPT="$2" - - echo "Debug: I am $0, $SCRIPT as param" + local SCRIPT="$0" git fetch --all # Od teď si musíme dát pozor, abychom nezměnili kód, který právě běží.