diff --git a/esbuild/utils.js b/esbuild/utils.js index 3326c2d39b..2d8356df2b 100644 --- a/esbuild/utils.js +++ b/esbuild/utils.js @@ -1,11 +1,16 @@ const path = require("path"); const fs = require("fs"); const chalk = require("chalk"); +let bench_path; +if (process.env.FRAPPE_BENCH_ROOT) { + bench_path = process.env.FRAPPE_BENCH_ROOT; +} else { + const frappe_path = path.resolve(__dirname, ".."); + bench_path = path.resolve(frappe_path, "..", ".."); +} -const frappe_path = path.resolve(__dirname, ".."); -const bench_path = path.resolve(frappe_path, "..", ".."); -const sites_path = path.resolve(bench_path, "sites"); const apps_path = path.resolve(bench_path, "apps"); +const sites_path = path.resolve(bench_path, "sites"); const assets_path = path.resolve(sites_path, "assets"); const app_list = get_apps_list(); diff --git a/node_utils.js b/node_utils.js index 88f1206e43..e237b14318 100644 --- a/node_utils.js +++ b/node_utils.js @@ -1,7 +1,12 @@ const fs = require("fs"); const path = require("path"); const redis = require("@redis/client"); -const bench_path = path.resolve(__dirname, "..", ".."); +let bench_path; +if (process.env.FRAPPE_BENCH_ROOT) { + bench_path = process.env.FRAPPE_BENCH_ROOT; +} else { + bench_path = path.resolve(__dirname, "..", ".."); +} const dns = require("dns");