Force sync install command with Gitea

This commit is contained in:
Tiago
2026-09-29 12:51:15 -03:00
parent 2acd6d4d02
commit 5e7f355dbb
+5 -4
View File
@@ -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."