Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Build assets only for downloaded app #802

Merged
merged 1 commit into from
May 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
7 changes: 5 additions & 2 deletions bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down