From d8ea0d9b1391d885645d873084ea8ab88208838b Mon Sep 17 00:00:00 2001 From: KrauTech Date: Sun, 15 Dec 2024 22:13:42 +1100 Subject: [PATCH] [FirmwareFlasher] Normalise GIT repo origin (#201) * add firmware.cfg to gitignore * increment to 0.0.6 * normalize katapult repo url to remove .git * removed increment --- .gitignore | 2 ++ scripts/firmware.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a81c8ee1..b6b93ac2 100644 --- a/.gitignore +++ b/.gitignore @@ -136,3 +136,5 @@ dmypy.json # Cython debug symbols cython_debug/ + +scripts/firmware.cfg diff --git a/scripts/firmware.py b/scripts/firmware.py index da243308..13f02dab 100755 --- a/scripts/firmware.py +++ b/scripts/firmware.py @@ -2244,7 +2244,11 @@ def verify_repository(self) -> bool: check=True, ) origin_url = result.stdout.strip().lower() - if origin_url != "https://github.com/arksine/katapult".lower(): + # Normalize URLs by removing '.git' at the end if present + normalized_url = origin_url.rstrip(".git") + expected_url = "https://github.com/arksine/katapult".rstrip(".git") + + if normalized_url != expected_url: Utils.error_msg(f"Unexpected repository URL: {origin_url}") return False except subprocess.CalledProcessError as e: