Skip to content

Commit

Permalink
fix: empty states json condition
Browse files Browse the repository at this point in the history
  • Loading branch information
saxenabhishek committed Mar 11, 2022
1 parent 7de1fa7 commit 67df07b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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",
Expand Down

0 comments on commit 67df07b

Please sign in to comment.