Skip to content

Commit

Permalink
fix: print required by in output
Browse files Browse the repository at this point in the history
  • Loading branch information
saxenabhishek committed Mar 10, 2022
1 parent 9004e1d commit 5bb3b52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def __init__(
self, name: str, branch: str = None, bench: "Bench" = None, *args, **kwargs
):
self.bench = bench
self.required_by = None
super().__init__(name, branch, *args, **kwargs)

@step(title="Fetching App {repo}", success="App {repo} Fetched")
Expand Down Expand Up @@ -246,6 +247,7 @@ def make_resolution_plan(app: App, bench: "Bench"):
for app_name in app._get_dependencies():
dep_app = App(app_name, bench=bench)
is_valid_frappe_branch(dep_app.url, dep_app.branch)
dep_app.required_by = app.name
if dep_app.repo in resolution:
click.secho(f"{dep_app.repo} is already resolved skipping", fg="yellow")
continue
Expand Down Expand Up @@ -345,7 +347,7 @@ def get_app(
resolution = make_resolution_plan(app, bench)
click.secho("Following apps will be installed", fg="yellow")
for idx, app in enumerate(reversed(resolution.values()), start=1):
print(f"{idx}. {app.name}")
print(f"{idx}. {app.name} {f'required by {app.required_by}' if app.required_by else ''}")

if "frappe" in resolution:
# Todo: Make frappe a terminal dependency for all frappe apps.
Expand Down

0 comments on commit 5bb3b52

Please sign in to comment.