From c55571118dc1a900124a4b7d23aaac1840184d3d Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sun, 16 Jun 2024 14:19:20 -0400 Subject: [PATCH] fix starting from non git repo --- CHANGELOG.md | 1 + installer.py | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05e09a158..e3df4a652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ - fix civitai download without name - fix compatibility with latest adetailer - fix invalid sampler warning +- fix starting from non git repo - restructure api examples: `cli/api-*` - handle theme fallback when invalid theme is specified diff --git a/installer.py b/installer.py index 2abb8b33d..3a7a91e00 100644 --- a/installer.py +++ b/installer.py @@ -1019,7 +1019,7 @@ def get_version(force=False): 'url': origin.replace('\n', '') + '/tree/' + branch_name.replace('\n', '') } except Exception: - version = { 'app': 'sd.next', 'version': 'unknown' } + version = { 'app': 'sd.next', 'version': 'unknown', 'branch': 'unknown' } try: cwd = os.getcwd() os.chdir('extensions-builtin/sdnext-modernui') @@ -1035,9 +1035,7 @@ def get_version(force=False): def check_ui(ver): - if ver is None: - return - if ver['branch'] == ver['ui']: + if ver is None or 'branch' not in ver or 'ui' not in ver or ver['branch'] == ver['ui']: return log.debug(f'Branch mismatch: sdnext={ver["branch"]} ui={ver["ui"]}') cwd = os.getcwd()