From 3471685eaa046b3db805984f425be13fd9022f92 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Mon, 31 Jul 2023 01:20:09 -0500 Subject: [PATCH] feat(ops): add environment variable to set bench root / workdir (#21872) --- frappe/utils/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/utils/__init__.py b/frappe/utils/__init__.py index dbe6c5b925..3f05734c41 100644 --- a/frappe/utils/__init__.py +++ b/frappe/utils/__init__.py @@ -509,7 +509,9 @@ def get_files_path(*path, **kwargs): def get_bench_path(): - return os.path.realpath(os.path.join(os.path.dirname(frappe.__file__), "..", "..", "..")) + return os.environ.get("FRAPPE_BENCH_ROOT") or os.path.realpath( + os.path.join(os.path.dirname(frappe.__file__), "..", "..", "..") + ) def get_bench_id():