2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 09:02:10 +00:00

fix: Build assets only for downloaded app (#802)

This commit is contained in:
Faris Ansari 2019-05-15 14:26:07 +05:30 committed by GitHub
parent 3374cbef2c
commit 75b0901af4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -137,7 +137,7 @@ def get_app(git_url, branch=None, bench_path='.', build_asset_files=True, verbos
if postprocess: if postprocess:
if build_asset_files: 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) conf = get_config(bench_path=bench_path)
if conf.get('restart_supervisor_on_update'): if conf.get('restart_supervisor_on_update'):

View File

@ -194,13 +194,16 @@ def patch_sites(bench_path='.'):
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
raise PatchError raise PatchError
def build_assets(bench_path='.'): def build_assets(bench_path='.', app=None):
bench.set_frappe_version(bench_path=bench_path) bench.set_frappe_version(bench_path=bench_path)
if bench.FRAPPE_VERSION == 4: if bench.FRAPPE_VERSION == 4:
exec_cmd("{frappe} --build".format(frappe=get_frappe(bench_path=bench_path)), cwd=os.path.join(bench_path, 'sites')) exec_cmd("{frappe} --build".format(frappe=get_frappe(bench_path=bench_path)), cwd=os.path.join(bench_path, 'sites'))
else: 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='.'): def get_sites(bench_path='.'):
sites_dir = os.path.join(bench_path, "sites") sites_dir = os.path.join(bench_path, "sites")