From 5e7f355dbba841d1b90519877be3ad6c6ed8713b Mon Sep 17 00:00:00 2001 From: Tiago Date: Tue, 29 Sep 2026 12:51:15 -0300 Subject: [PATCH] Force sync install command with Gitea --- scripts/seconectaicondominio.install | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/seconectaicondominio.install b/scripts/seconectaicondominio.install index e3de057..f60c29b 100755 --- a/scripts/seconectaicondominio.install +++ b/scripts/seconectaicondominio.install @@ -27,10 +27,11 @@ fi mkdir -p "$(dirname "$INSTALL_DIR")" if [[ -d "$INSTALL_DIR/.git" ]]; then - echo "Repositorio ja existe em $INSTALL_DIR. Atualizando codigo..." + echo "Repositorio ja existe em $INSTALL_DIR. Sincronizando com o Gitea..." + git -C "$INSTALL_DIR" remote remove origin >/dev/null 2>&1 || true + git -C "$INSTALL_DIR" remote add origin "$REPO_URL" git -C "$INSTALL_DIR" fetch origin "$BRANCH" - git -C "$INSTALL_DIR" checkout "$BRANCH" - git -C "$INSTALL_DIR" pull --ff-only origin "$BRANCH" + git -C "$INSTALL_DIR" checkout -B "$BRANCH" "origin/$BRANCH" -f else if [[ -e "$INSTALL_DIR" && -n "$(ls -A "$INSTALL_DIR" 2>/dev/null || true)" ]]; then if [[ -f "$INSTALL_DIR/pom.xml" && -d "$INSTALL_DIR/src" ]]; then @@ -39,7 +40,7 @@ else git -C "$INSTALL_DIR" remote remove origin >/dev/null 2>&1 || true git -C "$INSTALL_DIR" remote add origin "$REPO_URL" git -C "$INSTALL_DIR" fetch origin "$BRANCH" - git -C "$INSTALL_DIR" checkout -B "$BRANCH" "origin/$BRANCH" + git -C "$INSTALL_DIR" checkout -B "$BRANCH" "origin/$BRANCH" -f else echo "Erro: $INSTALL_DIR ja existe e nao parece ser este projeto." echo "Use outro INSTALL_DIR ou mova a pasta atual antes de instalar."