#!/bin/zsh # ============================================================ # Jhonny Editor - admin/Jhonny.command # # PONTO DE ENTRADA UNICO: builda/instala o painel do Premiere e, # se tudo deu certo, commita + faz push. # # 1. PremiereMCP.command build TS, reinstala a copia do painel # CEP, confere venv Python, reindexa RAG # 2. deploy.command commit + push (usa as notas de # admin/DEV-NOTES.md) # # Se o passo 1 falhar, o script PARA antes de commitar - nada de # publicar painel quebrado. # # Uso: # admin/Jhonny.command ciclo completo (commit + push automaticos) # AUTO=1 admin/Jhonny.command mantido por compatibilidade # SKIP_BUILD=1 admin/Jhonny.command pula o build (so commit+push) # SKIP_PYTHON=1 admin/Jhonny.command repassado ao PremiereMCP.command # SKIP_RAG=1 admin/Jhonny.command repassado ao PremiereMCP.command # ============================================================ set -u ADMIN="$(cd "$(dirname "$0")" && pwd -P)" GRN="$(tput setaf 2 2>/dev/null)"; YLW="$(tput setaf 3 2>/dev/null)" RD="$(tput setaf 1 2>/dev/null)"; BLU="$(tput setaf 4 2>/dev/null)" NC="$(tput sgr0 2>/dev/null)" step() { echo; echo "${BLU}============================================================${NC}" echo "${BLU} $*${NC}" echo "${BLU}============================================================${NC}"; } ok() { echo "${GRN}-> OK ${NC}$*"; } die() { echo "${RD}-> Erro: ${NC}$*" >&2; exit 1; } if [[ "${SKIP_BUILD:-0}" != "1" ]]; then step "1/2 - PremiereMCP.command (build + instalar painel)" "$ADMIN/PremiereMCP.command" || die "PremiereMCP.command falhou - corrija antes de publicar" ok "build/instalação concluída" else ok "SKIP_BUILD=1 - pulando etapa de build" fi step "2/2 - deploy.command (commit + push)" AUTO=1 "$ADMIN/deploy.command" || die "deploy.command falhou" ok "Jhonny.command concluído"