Fixed so that FOUNDRY_MAIN_PATH can be a node setup

This commit is contained in:
WBHarry 2026-06-07 15:21:35 +02:00
parent 8fec742da3
commit 28b53660b2

View file

@ -16,10 +16,10 @@ export function readEnvFile() {
}); });
// Determine foundry path, handling if its an electron install (nested structure) // Determine foundry path, handling if its an electron install (nested structure)
const foundryPath = path.normalize(process.env.FOUNDRY_MAIN_PATH); const foundryPath = path.normalize(process.env.FOUNDRY_MAIN_PATH).trimEnd();
const dataPath = path.normalize(process.env.FOUNDRY_DATA_PATH); const dataPath = path.normalize(process.env.FOUNDRY_DATA_PATH).trimEnd();
if (!foundryPath.endsWith(path.join('app', 'main.js'))) { if (!foundryPath.endsWith('main.js')) {
console.error('Configured FOUNDRY_MAIN_PATH is invalid, it must end with app/main.js'); console.error('Configured FOUNDRY_MAIN_PATH is invalid, it must end with main.js');
process.exit(); process.exit();
} }
if (/Data(\/|\\)?$/.test(dataPath) || !fs.existsSync(path.join(dataPath, 'Data'))) { if (/Data(\/|\\)?$/.test(dataPath) || !fs.existsSync(path.join(dataPath, 'Data'))) {