From 75b0901af4d26502fd8763f7947ec7f465de418c Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 15 May 2019 14:26:07 +0530 Subject: [PATCH] fix: Build assets only for downloaded app (#802) --- bench/app.py | 2 +- bench/utils.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bench/app.py b/bench/app.py index 971e4a25..896affa2 100755 --- a/bench/app.py +++ b/bench/app.py @@ -137,7 +137,7 @@ def get_app(git_url, branch=None, bench_path='.', build_asset_files=True, verbos if postprocess: if build_asset_files: - build_assets(bench_path=bench_path) + build_assets(bench_path=bench_path, app=app_name) conf = get_config(bench_path=bench_path) if conf.get('restart_supervisor_on_update'): diff --git a/bench/utils.py b/bench/utils.py index 317ff794..c531eb8f 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -194,13 +194,16 @@ def patch_sites(bench_path='.'): except subprocess.CalledProcessError: raise PatchError -def build_assets(bench_path='.'): +def build_assets(bench_path='.', app=None): bench.set_frappe_version(bench_path=bench_path) if bench.FRAPPE_VERSION == 4: exec_cmd("{frappe} --build".format(frappe=get_frappe(bench_path=bench_path)), cwd=os.path.join(bench_path, 'sites')) else: - run_frappe_cmd('build', bench_path=bench_path) + command = 'bench build' + if app: + command += ' --app {}'.format(app) + exec_cmd(command, cwd=bench_path) def get_sites(bench_path='.'): sites_dir = os.path.join(bench_path, "sites")