mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
fix run_frappe_cmd
This commit is contained in:
parent
feceb591d4
commit
0ed4726452
@ -65,7 +65,7 @@ def new_app(app, bench='.'):
|
|||||||
exec_cmd("{frappe} --make_app {apps} {app}".format(frappe=get_frappe(bench=bench),
|
exec_cmd("{frappe} --make_app {apps} {app}".format(frappe=get_frappe(bench=bench),
|
||||||
apps=apps, app=app))
|
apps=apps, app=app))
|
||||||
else:
|
else:
|
||||||
run_frappe_cmd('make-app', apps, app)
|
run_frappe_cmd('make-app', apps, app, bench=bench)
|
||||||
install_app(app, bench=bench)
|
install_app(app, bench=bench)
|
||||||
|
|
||||||
def install_app(app, bench='.'):
|
def install_app(app, bench='.'):
|
||||||
|
@ -110,13 +110,13 @@ def patch_sites(bench='.'):
|
|||||||
if FRAPPE_VERSION == '4':
|
if FRAPPE_VERSION == '4':
|
||||||
exec_cmd("{frappe} --latest all".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites'))
|
exec_cmd("{frappe} --latest all".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites'))
|
||||||
else:
|
else:
|
||||||
run_frappe_cmd('--site', 'all', 'migrate')
|
run_frappe_cmd('--site', 'all', 'migrate', bench=bench)
|
||||||
|
|
||||||
def build_assets(bench='.'):
|
def build_assets(bench='.'):
|
||||||
if FRAPPE_VERSION == '4':
|
if FRAPPE_VERSION == '4':
|
||||||
exec_cmd("{frappe} --build".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites'))
|
exec_cmd("{frappe} --build".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites'))
|
||||||
else:
|
else:
|
||||||
run_frappe_cmd('build')
|
run_frappe_cmd('build', bench=bench)
|
||||||
|
|
||||||
def get_sites(bench='.'):
|
def get_sites(bench='.'):
|
||||||
sites_dir = os.path.join(bench, "sites")
|
sites_dir = os.path.join(bench, "sites")
|
||||||
@ -411,8 +411,8 @@ def get_current_frappe_version():
|
|||||||
from .app import get_current_frappe_version as fv
|
from .app import get_current_frappe_version as fv
|
||||||
return fv()
|
return fv()
|
||||||
|
|
||||||
def run_frappe_cmd(*args):
|
def run_frappe_cmd(*args, **kwargs):
|
||||||
bench = '.'
|
bench = kwargs.get('bench', '.')
|
||||||
f = get_env_cmd('python', bench=bench)
|
f = get_env_cmd('python', bench=bench)
|
||||||
sites_dir = os.path.join(bench, 'sites')
|
sites_dir = os.path.join(bench, 'sites')
|
||||||
subprocess.check_call((f, '-m', 'frappe.utils.bench_helper', 'frappe') + args, cwd=sites_dir)
|
subprocess.check_call((f, '-m', 'frappe.utils.bench_helper', 'frappe') + args, cwd=sites_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user