diff --git a/app/utils.py b/app/utils.py index 05883a9..a0b5344 100644 --- a/app/utils.py +++ b/app/utils.py @@ -47,6 +47,7 @@ def check_latest_commit(self): """Check if the API has the latest commit of the schemas repository""" print("Checking latest commit") path = os.path.join(self.folder, ".git") + commit = None if os.path.isdir(path): # Local development with open(os.path.join(path, "refs", "heads", "main")) as f: commit = f.readline().strip() @@ -58,7 +59,9 @@ def check_latest_commit(self): if match: commit = match.group(1).strip() assert commit - if commit != self.latest_commit: + else: + print(f"Warning: {path} does not exist??") + if commit != self.latest_commit and commit: self.update() self.latest_commit = commit