2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-14 09:14:04 +00:00

build assets only once if installing from a list from path

This commit is contained in:
Pratik Vyas 2014-12-03 10:37:44 +05:30
parent 09b0067992
commit 91c2de9afb

View File

@ -30,7 +30,7 @@ def write_appstxt(apps, bench='.'):
with open(os.path.join(bench, 'sites', 'apps.txt'), 'w') as f: with open(os.path.join(bench, 'sites', 'apps.txt'), 'w') as f:
return f.write('\n'.join(apps)) return f.write('\n'.join(apps))
def get_app(app, git_url, branch=None, bench='.'): def get_app(app, git_url, branch=None, bench='.', build_assets=True):
logger.info('getting app {}'.format(app)) logger.info('getting app {}'.format(app))
shallow_clone = '--depth 1' if check_git_for_shallow_clone() and get_config().get('shallow_clone') else '' shallow_clone = '--depth 1' if check_git_for_shallow_clone() and get_config().get('shallow_clone') else ''
branch = '--branch {branch}'.format(branch=branch) if branch else '' branch = '--branch {branch}'.format(branch=branch) if branch else ''
@ -42,6 +42,7 @@ def get_app(app, git_url, branch=None, bench='.'):
cwd=os.path.join(bench, 'apps')) cwd=os.path.join(bench, 'apps'))
print 'installing', app print 'installing', app
install_app(app, bench=bench) install_app(app, bench=bench)
if build_assets:
build_assets(bench=bench) build_assets(bench=bench)
conf = get_config() conf = get_config()
if conf.get('restart_supervisor_on_update'): if conf.get('restart_supervisor_on_update'):
@ -78,7 +79,8 @@ def get_current_branch(repo_dir):
def install_apps_from_path(path, bench='.'): def install_apps_from_path(path, bench='.'):
apps = get_apps_json(path) apps = get_apps_json(path)
for app in apps: for app in apps:
get_app(app['name'], app['url'], branch=app.get('branch'), bench=bench) get_app(app['name'], app['url'], branch=app.get('branch'), bench=bench, build_assets=False)
build_assets(bench=bench)
def get_apps_json(path): def get_apps_json(path):
if path.startswith('http'): if path.startswith('http'):