This commit is contained in:
Luiz Silva 2026-10-14 17:22:17 -03:00
parent cb90e4d858
commit 212d2578f4

View file

@ -50,8 +50,14 @@ if [ -f "$SUPER_DIR/.gitmodules" ]; then
git -C "$SUPER_DIR" config -f .gitmodules submodule..agent.branch master 2>/dev/null || true
fi
# Executar a atualização remota do submódulo .agent
if git -C "$SUPER_DIR" submodule update --init --recursive --remote .agent >/dev/null 2>&1; then
# Executar a atualização remota do submódulo .agent preservando commits locais (rebase)
if git -C "$SUPER_DIR" submodule update --init --recursive --remote --rebase .agent >/dev/null 2>&1 || \
git -C "$SUPER_DIR" submodule update --init --recursive --remote .agent >/dev/null 2>&1; then
# Remover script legado menu/graphify-atualizar.sh (substituído por .agent/scripts/graphify.sh) e garantir .gitignore
rm -f "$SUPER_DIR/menu/graphify-atualizar.sh" 2>/dev/null || true
if [ -f "$SUPER_DIR/.agent/scripts/graphify.sh" ]; then
bash "$SUPER_DIR/.agent/scripts/graphify.sh" gitignore >/dev/null 2>&1 || true
fi
[ -n "$CONV_ID" ] && touch "$LOCK_FILE" 2>/dev/null || true
if [ "$IS_PIPE" -eq 1 ] && [ -n "$INPUT_JSON" ]; then
echo '{"injectSteps":[{"ephemeralMessage":"ℹ️ Submódulo .agent sincronizado com sucesso na branch master (git submodule update --init --recursive --remote)."}]}'