Skip to content

Commit

Permalink
Remove debug
Browse files Browse the repository at this point in the history
Adiciona colorama
  • Loading branch information
LuizWT committed Nov 14, 2024
1 parent 2699fdf commit 920a536
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions configurations/ar_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import subprocess
import argparse
import sys
from colorama import Fore, init

init(autoreset=True)
# Função para verificar se o script está sendo executado dentro de um repositório Git
def is_git_repo(path):
try:
Expand All @@ -16,10 +18,7 @@ def get_git_repo_path(start_path=None):
if start_path is None:
start_path = os.getcwd()

print(f"[DEBUG] Verificando repositório a partir de: {start_path}")

while os.path.exists(os.path.join(start_path, '.git')):
print(f"[DEBUG] Repositório encontrado em: {start_path}")
return start_path

parent_dir = os.path.dirname(start_path)
Expand Down Expand Up @@ -55,7 +54,7 @@ def update_repository():
subprocess.run(['sudo', 'git', 'fetch'], check=True, cwd=repo_path, env=env)
subprocess.run(['sudo', 'git', 'pull'], check=True, cwd=repo_path, env=env)

print("Código atualizado com sucesso.")
print(f"{Fore.GREEN}Código atualizado com sucesso.")
except subprocess.CalledProcessError as e:
print(f"[ERROR] Falha ao atualizar o repositório: {e}")
sys.exit(1)
Expand Down

0 comments on commit 920a536

Please sign in to comment.