Fixed so that FOUNDRY_MAIN_PATH can be a node setup (#1984)

This commit is contained in:
WBHarry 2026-06-07 15:23:55 +02:00 committed by GitHub
parent 8fec742da3
commit 67cd28f991
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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'))) {