From 67cd28f991f955d911a581bd197e5e789e4ea469 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Sun, 7 Jun 2026 15:23:55 +0200 Subject: [PATCH] Fixed so that FOUNDRY_MAIN_PATH can be a node setup (#1984) --- tools/util.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/util.mjs b/tools/util.mjs index 3af83540..6add7ea4 100644 --- a/tools/util.mjs +++ b/tools/util.mjs @@ -16,10 +16,10 @@ export function readEnvFile() { }); // Determine foundry path, handling if its an electron install (nested structure) - const foundryPath = path.normalize(process.env.FOUNDRY_MAIN_PATH); - const dataPath = path.normalize(process.env.FOUNDRY_DATA_PATH); - if (!foundryPath.endsWith(path.join('app', 'main.js'))) { - console.error('Configured FOUNDRY_MAIN_PATH is invalid, it must end with app/main.js'); + const foundryPath = path.normalize(process.env.FOUNDRY_MAIN_PATH).trimEnd(); + const dataPath = path.normalize(process.env.FOUNDRY_DATA_PATH).trimEnd(); + if (!foundryPath.endsWith('main.js')) { + console.error('Configured FOUNDRY_MAIN_PATH is invalid, it must end with main.js'); process.exit(); } if (/Data(\/|\\)?$/.test(dataPath) || !fs.existsSync(path.join(dataPath, 'Data'))) {