From 64c1d302994eaf15278ec2ed00919d6546f8a322 Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Thu, 23 Nov 2023 18:02:42 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20repo=20reset=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/update | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/update b/scripts/update index 0421bd4..db37dd8 100755 --- a/scripts/update +++ b/scripts/update @@ -5,24 +5,20 @@ wrkDir="/home/discord/droidscord" cd "$wrkDir" || exit 1 -if ! git reset --hard "$targetBranch"; then - echo "👹 Oops! Failed to clear stage" - - exit 1 -fi - if ! git checkout "$targetBranch"; then echo "👹 Oops! Failed to switch branch" exit 1 fi -if ! git pull origin "$targetBranch"; then - echo "👹 Oops! Failed to pull latest" +if ! git fetch origin || ! git reset --hard "origin/$targetBranch"; then + echo "👹 Oops! Failed to clear stage" exit 1 fi +git clean -f + if ! docker compose ps --format "{{.Service}} {{.State}}" | grep 'llm_indexer running' || ! docker compose ps --format "{{.Service}} {{.State}}" | grep 'discordjs-bot'; then echo "⚠️ Warrning: Docker compose stack is down" echo "🤖 Should start compose stack, be patient..."