2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-08 16:14:12 +00:00

fix: empty states json condition

This commit is contained in:
saxenabhishek 2022-03-11 13:22:49 +05:30
parent 7de1fa7c4d
commit 67df07b732

View File

@ -415,7 +415,11 @@ def install_resolved_deps(
if existing_dir:
is_compatible = False
installed_branch = bench.apps.states[repo_name]["resolution"]["branch"].strip()
try:
installed_branch = bench.apps.states[repo_name]["resolution"]["branch"].strip()
except:
installed_branch = None
if app.tag is None:
current_remote = (
subprocess.check_output(f"git config branch.{installed_branch}.remote", shell=True, cwd=path_to_app)
@ -433,7 +437,7 @@ def install_resolved_deps(
)
is_compatible = default_branch == installed_branch
else:
is_compatible = bench.apps.states[repo_name]["resolution"]["branch"] == app.tag
is_compatible = installed_branch == app.tag
click.secho(
f"{'C' if is_compatible else 'Inc'}ompatible version of {repo_name} is already installed",