mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 00:37:51 +00:00
add more options to bench init
This commit is contained in:
parent
e8965c0f3f
commit
314d243786
10
bench/cli.py
10
bench/cli.py
@ -39,9 +39,15 @@ def bench(bench='.'):
|
|||||||
@click.command()
|
@click.command()
|
||||||
@click.argument('path')
|
@click.argument('path')
|
||||||
@click.option('--apps_path', default=None, help="path to json files with apps to install after init")
|
@click.option('--apps_path', default=None, help="path to json files with apps to install after init")
|
||||||
def init(path, apps_path):
|
@click.option('--frappe-path', default=None, help="path to frappe repo")
|
||||||
|
@click.option('--no-procfile', flag_value=True, type=bool, help="Pull changes in all the apps in bench")
|
||||||
|
@click.option('--no-backups',flag_value=True, type=bool, help="Run migrations for all sites in the bench")
|
||||||
|
@click.option('--no-auto-update',flag_value=True, type=bool, help="Build JS and CSS artifacts for the bench")
|
||||||
|
def init(path, apps_path, frappe_path, no_procfile, no_backups,
|
||||||
|
no_auto_update):
|
||||||
"Create a new bench"
|
"Create a new bench"
|
||||||
_init(path, apps_path=apps_path)
|
_init(path, apps_path=apps_path, no_procfile=no_procfile, no_backups=no_backups,
|
||||||
|
no_auto_update=no_auto_update, frappe_path=frappe_path)
|
||||||
click.echo('Bench {} initialized'.format(path))
|
click.echo('Bench {} initialized'.format(path))
|
||||||
|
|
||||||
@click.command('get-app')
|
@click.command('get-app')
|
||||||
|
@ -24,7 +24,8 @@ def get_frappe(bench='.'):
|
|||||||
print 'bench get-app frappe https://github.com/frappe/frappe.git'
|
print 'bench get-app frappe https://github.com/frappe/frappe.git'
|
||||||
return frappe
|
return frappe
|
||||||
|
|
||||||
def init(path, apps_path=None):
|
def init(path, apps_path=None, no_procfile=False, no_backups=False,
|
||||||
|
no_auto_update=False, frappe_path=None):
|
||||||
from .app import get_app, install_apps_from_path
|
from .app import get_app, install_apps_from_path
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
print 'Directory {} already exists!'.format(path)
|
print 'Directory {} already exists!'.format(path)
|
||||||
@ -38,10 +39,15 @@ def init(path, apps_path=None):
|
|||||||
|
|
||||||
setup_env(bench=path)
|
setup_env(bench=path)
|
||||||
put_config(default_config, bench=path)
|
put_config(default_config, bench=path)
|
||||||
get_app('frappe', 'https://github.com/frappe/frappe.git', bench=path)
|
if not frappe_path:
|
||||||
setup_procfile(bench=path)
|
frappe_path = 'https://github.com/frappe/frappe.git'
|
||||||
setup_backups(bench=path)
|
get_app('frappe', frappe_path, bench=path)
|
||||||
setup_auto_update(bench=path)
|
if not no_procfile:
|
||||||
|
setup_procfile(bench=path)
|
||||||
|
if not no_backups:
|
||||||
|
setup_backups(bench=path)
|
||||||
|
if not no_auto_update:
|
||||||
|
setup_auto_update(bench=path)
|
||||||
if apps_path:
|
if apps_path:
|
||||||
install_apps_from_path(apps_path, bench=path)
|
install_apps_from_path(apps_path, bench=path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user