make/lib: safe_checkout_branch stačí 1 parametr
This commit is contained in:
parent
e4c2eda955
commit
a390ef0329
3 changed files with 4 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -48,14 +48,12 @@ function only_in_directory {
|
|||
function safe_checkout_branch {
|
||||
if "$#" -ne 2
|
||||
then
|
||||
echo >&2 "Použití: $0 <branch> <current-script>"
|
||||
echo >&2 "Použití: $0 <branch>"
|
||||
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ěží.
|
||||
|
|
Loading…
Reference in a new issue