fix starting from non git repo

This commit is contained in:
Vladimir Mandic
2024-06-16 14:19:20 -04:00
parent 8c94047cf3
commit c55571118d
2 changed files with 3 additions and 4 deletions
+1
View File
@@ -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
+2 -4
View File
@@ -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()