From a184bb867430305f4c8fd3e57d6ee869bcd7a289 Mon Sep 17 00:00:00 2001 From: fe-art Date: Thu, 12 Sep 2024 13:56:08 +0200 Subject: [PATCH] add warning and skip git updates if no git repository found --- clashroyalebuildabot/utils/git_utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clashroyalebuildabot/utils/git_utils.py b/clashroyalebuildabot/utils/git_utils.py index 53e4b97..e8b67e0 100644 --- a/clashroyalebuildabot/utils/git_utils.py +++ b/clashroyalebuildabot/utils/git_utils.py @@ -1,5 +1,6 @@ import subprocess import sys +from time import sleep from loguru import logger @@ -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)