Throw a more clear error when the compendia build fails

This commit is contained in:
Oliver-Akins 2025-05-31 11:03:55 -06:00
parent 0b89b0e54e
commit d11b270019

View file

@ -68,7 +68,11 @@ function buildPacks() {
return { return {
async writeBundle(options) { async writeBundle(options) {
const buildDir = options.dir; const buildDir = options.dir;
try {
await buildCompendia(); await buildCompendia();
} catch {
throw new Error(`Compendium building failed, make sure Foundry isn't running`);
};
await cp(`${__dirname}/packs`, `${buildDir}/packs`, { recursive: true, force: true }); await cp(`${__dirname}/packs`, `${buildDir}/packs`, { recursive: true, force: true });
for (const file of glob.sync(`${buildDir}/packs/**/_source/`)) { for (const file of glob.sync(`${buildDir}/packs/**/_source/`)) {
await rm(file, { recursive: true, force: true }); await rm(file, { recursive: true, force: true });