From 76999e9ed849e63918896b5346698e20f1d039dd Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Wed, 4 Mar 2015 11:32:12 +0530 Subject: [PATCH] fix get_frappe_commands --- bench/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bench/cli.py b/bench/cli.py index 26f0c1c9..4a90ac35 100644 --- a/bench/cli.py +++ b/bench/cli.py @@ -102,6 +102,8 @@ def frappe_cmd(bench='.'): def get_frappe_commands(bench='.'): python = get_env_cmd('python', bench=bench) sites_path = os.path.join(bench, 'sites') + if not os.path.exists(sites_path): + return [] try: return json.loads(get_cmd_output("{python} -m frappe.utils.bench_helper get-frappe-commands".format(python=python), cwd=sites_path)) except subprocess.CalledProcessError: @@ -110,6 +112,8 @@ def get_frappe_commands(bench='.'): def get_frappe_help(bench='.'): python = get_env_cmd('python', bench=bench) sites_path = os.path.join(bench, 'sites') + if not os.path.exists(sites_path): + return [] try: out = get_cmd_output("{python} -m frappe.utils.bench_helper get-frappe-help".format(python=python), cwd=sites_path) return "Framework commands:\n" + out.split('Commands:')[1]