Skip to content

Commit

Permalink
fix: Show bench init job via bench get-app (conditional)
Browse files Browse the repository at this point in the history
This happens when dynamic-feed is enabled
  • Loading branch information
gavindsouza committed Nov 18, 2021
1 parent f230778 commit 225fce5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,19 +277,31 @@ def get_app(
git_url parameter.
"""
from bench.bench import Bench
import bench as bench_cli

bench = Bench(bench_path)
app = App(git_url, branch=branch, bench=bench)
git_url = app.url
repo_name = app.repo
branch = app.tag
bench_setup = False

if not is_bench_directory(bench_path):
from bench.utils.system import init

bench_path = get_available_folder_name(f"{app.repo}-bench", bench_path)
init(path=bench_path, frappe_branch=branch)
os.chdir(bench_path)
bench_setup = True

if bench_setup and bench_cli.cli.from_command_line and bench_cli.cli.dynamic_feed:
bench_cli.LOG_BUFFER.append({
"message": f"Fetching App {repo_name}",
"prefix": click.style('⏼', fg='bright_yellow'),
"is_parent": True,
"color": None,
})


cloned_path = os.path.join(bench_path, "apps", repo_name)
dir_already_exists = os.path.isdir(cloned_path)
Expand Down

0 comments on commit 225fce5

Please sign in to comment.