Updated deploy script with build specific ymlLdb script (#709)

This commit is contained in:
WBHarry 2025-08-08 00:42:43 +02:00 committed by GitHub
parent cfbc2e72ff
commit a19c77ae4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 2 deletions

View file

@ -0,0 +1,31 @@
import { compilePack } from '@foundryvtt/foundryvtt-cli';
import { promises as fs } from 'fs';
const MODULE_ID = process.cwd();
const yaml = false;
const packs = await deepGetDirectories('./packs');
console.log(packs);
for (const pack of packs) {
if (pack === '.gitattributes') continue;
console.log('Packing ' + pack);
await compilePack(`${MODULE_ID}/src/${pack}`, `${MODULE_ID}/${pack}`, { yaml });
}
async function deepGetDirectories(distPath) {
const dirr = await fs.readdir('src/' + distPath);
const dirrsWithSub = [];
for (let file of dirr) {
const stat = await fs.stat('src/' + distPath + '/' + file);
if (stat.isDirectory()) {
const deeper = await deepGetDirectories(distPath + '/' + file);
if (deeper.length > 0) {
dirrsWithSub.push(...deeper);
} else {
dirrsWithSub.push(distPath + '/' + file);
}
}
}
return dirrsWithSub;
}