From 800bb5687c69a035bc57fb0749726b44af9247f6 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 16 Apr 2022 13:08:23 +0530 Subject: [PATCH] fix: pull changes before committing changes to deployment branch --- scripts/zola.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/zola.sh b/scripts/zola.sh index 8916e70..c116d4f 100755 --- a/scripts/zola.sh +++ b/scripts/zola.sh @@ -100,8 +100,11 @@ deploy() { if [[ -z $(git branch --list $1) ]] then + "[*] Creating deployment branch $1" git checkout --orphan $1 else + "[*] Deployment branch $1 exists, pulling changes from remote" + git pull origin $1 --force git checkout $1 fi @@ -109,7 +112,7 @@ deploy() { /bin/rm -rf * cp -r $tmp_dir/* . git add --all - if [ ! -z $(git status --porcelain) ]; + if [ -n $(git status --porcelain) ]; then git commit \ --author="$3" \