mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 16:36:25 +00:00
fix: check current branch
This commit is contained in:
parent
c71432de3c
commit
2287f3f7ec
29
bench/app.py
29
bench/app.py
@ -428,17 +428,32 @@ def install_resolved_deps(
|
|||||||
del resolution["frappe"]
|
del resolution["frappe"]
|
||||||
|
|
||||||
for repo_name, app in reversed(resolution.items()):
|
for repo_name, app in reversed(resolution.items()):
|
||||||
existing_dir, _ = check_existing_dir(bench_path, repo_name)
|
existing_dir, path_to_app = check_existing_dir(bench_path, repo_name)
|
||||||
if existing_dir:
|
if existing_dir:
|
||||||
if bench.apps.states[repo_name]["resolution"]["branch"] != app.tag:
|
is_compatible = False
|
||||||
click.secho(
|
|
||||||
f"Incompatible version of {repo_name} is already installed",
|
installed_branch = bench.apps.states[repo_name]["resolution"]["branch"].strip()
|
||||||
fg="yellow",
|
if app.tag is None:
|
||||||
|
current_remote = (
|
||||||
|
subprocess.check_output(f"git config branch.{installed_branch}.remote", shell=True, cwd=path_to_app)
|
||||||
|
.decode("utf-8")
|
||||||
|
.rstrip()
|
||||||
)
|
)
|
||||||
app.install_resolved_apps(skip_assets=skip_assets, verbose=verbose)
|
|
||||||
|
default_branch = (
|
||||||
|
subprocess.check_output(
|
||||||
|
f"git symbolic-ref refs/remotes/{current_remote}/HEAD", shell=True, cwd=path_to_app
|
||||||
|
)
|
||||||
|
.decode("utf-8")
|
||||||
|
.rsplit("/")[-1]
|
||||||
|
.strip()
|
||||||
|
)
|
||||||
|
is_compatible = default_branch == installed_branch
|
||||||
else:
|
else:
|
||||||
|
is_compatible = bench.apps.states[repo_name]["resolution"]["branch"] == app.tag
|
||||||
|
|
||||||
click.secho(
|
click.secho(
|
||||||
f"Compatible version of {repo_name} is already installed",
|
f"{'C' if is_compatible else 'Inc'}ompatible version of {repo_name} is already installed",
|
||||||
fg="yellow",
|
fg="yellow",
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user