🚀 Auto-deploy: BotVPS atualizado em 28/03/2026 19:27:25

This commit is contained in:
2026-03-28 19:27:25 +00:00
parent bf8416bc60
commit ff688b76b6
2 changed files with 24 additions and 3 deletions

View File

@@ -16,7 +16,16 @@ def run_bash(command: str, timeout: int = 120) -> Dict:
# Auto-moderniza docker-compose
command = command.replace("docker-compose", "docker compose")
try:
result = subprocess.run(command, shell=True, capture_output=True, text=True, timeout=timeout)
# Garante caminhos comuns no PATH para execução via PM2/Containers
custom_env = os.environ.copy()
paths = ["/usr/local/bin", "/root/.cargo/bin", "/usr/bin", "/bin"]
current_path = custom_env.get("PATH", "")
for p in paths:
if p not in current_path:
current_path = f"{p}:{current_path}"
custom_env["PATH"] = current_path
result = subprocess.run(command, shell=True, capture_output=True, text=True, timeout=timeout, env=custom_env)
return {
"success": result.returncode == 0,
"output": (result.stdout or result.stderr).strip() or "Sucesso"