From 0d81bb965422a78000042dc3b2b57de7f5de8358 Mon Sep 17 00:00:00 2001 From: genofire's bot Date: Tue, 16 Jun 2020 13:00:45 +0200 Subject: [PATCH] bot update --- update.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/update.sh b/update.sh index 97e085f..7bc2f9d 100755 --- a/update.sh +++ b/update.sh @@ -5,9 +5,13 @@ wget -q -O open_software.md "https://md.ccc-mannheim.de/-H4XaDXbTn-3q_ES2RTxDA/d if [[ ! -z "$(git status --porcelain --ignore-submodules -unormal)" ]]; then echo "[bot] commit dirty changes" - git commit -m "bot update" *.md + git commit -m "bot update" -a fi -if [[ "$(git rev-list --left-right --count HEAD...@'{u}')" != "0 0" ]]; then +if [[ "$(git rev-list --left-right --count HEAD...@'{u}' | cut -f2 )" != "0" ]]; then + echo "[bot] fetch current version" + git pull --rebase +fi +if [[ "$(git rev-list --left-right --count HEAD...@'{u}' | cut -f1 )" != "0" ]]; then echo "[bot] push commits" git remote | xargs -L1 git push --all fi