From 028fcaa2d38c5ff1e808a11748849aab8e25fa38 Mon Sep 17 00:00:00 2001 From: Kyle Tyo Date: Wed, 17 Jun 2026 22:14:54 -0400 Subject: [PATCH] Fix illegible FileNotFoundError occurrences when git isn't in path. (#6) * Update git_helper.py * Update git_helper.py * Update git_helper.py --- BuildChecker/git_helper.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/BuildChecker/git_helper.py b/BuildChecker/git_helper.py index 4e42b1e70e..b5fe56a00a 100644 --- a/BuildChecker/git_helper.py +++ b/BuildChecker/git_helper.py @@ -49,9 +49,6 @@ def update_submodules(): if os.path.isfile("DISABLE_SUBMODULE_AUTOUPDATE"): return - if shutil.which("git") is None: - raise FileNotFoundError("git not found in PATH") - # If the status doesn't match, force VS to reload the solution. # status = run_command(["git", "submodule", "status"], capture=True) run_command(["git", "submodule", "update", "--init", "--recursive"]) @@ -112,12 +109,19 @@ def check_for_zip_download(): "Such as information to download the engine or even the ability to even be able to create contributions. \n" "Please read and follow https://docs.spacestation14.com/en/general-development/setup/setting-up-a-development-environment.html \n" "If you just want a Sandbox Server, you are following the wrong guide! You can download a premade server following the instructions here:" - "https://docs.spacestation14.com/en/general-development/setup/server-hosting-tutorial.html \n" - "Closing automatically in 30 seconds.") - time.sleep(30) + "https://docs.spacestation14.com/en/general-development/setup/server-hosting-tutorial.html") + exit(1) + +def check_path_for_git(): + """ + Check git is invokable before trying to invoke it. + """ + if shutil.which("git") is None: + print("git not found in PATH. Ensure git is installed and in PATH and run this program again!") exit(1) if __name__ == '__main__': + check_path_for_git() check_for_zip_download() install_hooks() update_submodules()