From 0ed47264525b4e0ad200fa1444b764db2082969a Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Tue, 3 Mar 2015 16:46:25 +0530 Subject: [PATCH] fix run_frappe_cmd --- bench/app.py | 2 +- bench/utils.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bench/app.py b/bench/app.py index 18ee11c0..8f868aec 100644 --- a/bench/app.py +++ b/bench/app.py @@ -65,7 +65,7 @@ def new_app(app, bench='.'): exec_cmd("{frappe} --make_app {apps} {app}".format(frappe=get_frappe(bench=bench), apps=apps, app=app)) else: - run_frappe_cmd('make-app', apps, app) + run_frappe_cmd('make-app', apps, app, bench=bench) install_app(app, bench=bench) def install_app(app, bench='.'): diff --git a/bench/utils.py b/bench/utils.py index 357ae433..792d1203 100644 --- a/bench/utils.py +++ b/bench/utils.py @@ -110,13 +110,13 @@ def patch_sites(bench='.'): if FRAPPE_VERSION == '4': exec_cmd("{frappe} --latest all".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites')) else: - run_frappe_cmd('--site', 'all', 'migrate') + run_frappe_cmd('--site', 'all', 'migrate', bench=bench) def build_assets(bench='.'): if FRAPPE_VERSION == '4': exec_cmd("{frappe} --build".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites')) else: - run_frappe_cmd('build') + run_frappe_cmd('build', bench=bench) def get_sites(bench='.'): 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 return fv() -def run_frappe_cmd(*args): - bench = '.' +def run_frappe_cmd(*args, **kwargs): + bench = kwargs.get('bench', '.') f = get_env_cmd('python', bench=bench) sites_dir = os.path.join(bench, 'sites') subprocess.check_call((f, '-m', 'frappe.utils.bench_helper', 'frappe') + args, cwd=sites_dir)