Skip to content

Commit

Permalink
add warning and skip git updates if no git repository found
Browse files Browse the repository at this point in the history
  • Loading branch information
fe-art committed Sep 12, 2024
1 parent 90a21a2 commit a184bb8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions clashroyalebuildabot/utils/git_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import subprocess
import sys
from time import sleep

from loguru import logger

Expand Down Expand Up @@ -34,5 +35,11 @@ def check_and_pull_updates() -> None:
try:
_check_and_pull_updates()
except subprocess.CalledProcessError as e:
if "not a git repository" in e.stderr:
err = "We recommend getting the project using git."
err += "You won't be able to get any updates until you do."
logger.warning(err)
sleep(3)
return
logger.error(f"Error while checking / pulling updates: {e.stderr}")
sys.exit(1)

0 comments on commit a184bb8

Please sign in to comment.