162
throw new Error(`Foundry Local native runtime download from ${url} completed but expected files are missing.`);
163
}
165
>
await promoteDir(dirname(stagingAddon), dirname(addonPath));
166
>
await promoteDir(stagingCore, coreDir);
167
} finally {
168
await fs.promises.rm(staging, { recursive: true, force: true }).catch(() => { /* best effort */ });
169
}
171
>
// Verify the published payload — ours or a concurrent winner's — is complete.
172
if (!fs.existsSync(addonPath) || !hasAllCoreLibraries(coreDir)) {
173
throw new Error('Foundry Local native runtime is incomplete after provisioning.');
174
}
176
>
await fs.promises.writeFile(foundryMarkerPath(overrideDir, platformKey), `${version}\n`).catch(() => { /* best effort marker */ });
177
>
}
178
179
/** Path of the per-platform completion marker inside a versioned override dir. */