mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Updated deploy script with build specific ymlLdb script (#709)
This commit is contained in:
parent
cfbc2e72ff
commit
a19c77ae4a
4 changed files with 34 additions and 2 deletions
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
|
|
@ -15,7 +15,7 @@ jobs:
|
|||
|
||||
- name: Build Packs
|
||||
run: |
|
||||
npm run pullYMLtoLDB
|
||||
npm run pullYMLtoLDBBuild
|
||||
mv --force src/packs/LICENSE packs/LICENSE
|
||||
|
||||
- name: Build daggerheart.js
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
"readline": "^1.3.0",
|
||||
"pushLDBtoYML": "node ./tools/pushLDBtoYML.mjs",
|
||||
"pullYMLtoLDB": "node ./tools/pullYMLtoLDB.mjs",
|
||||
"pullYMLtoLDBBuild": "node ./tools/pullYMLtoLDBBuild.mjs",
|
||||
"createSymlink": "node ./tools/create-symlink.mjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"id": "daggerheart",
|
||||
"title": "Daggerheart",
|
||||
"description": "An unofficial implementation of the Daggerheart system",
|
||||
"version": "0.0.1",
|
||||
"version": "1.0.0",
|
||||
"compatibility": {
|
||||
"minimum": "13",
|
||||
"verified": "13.347",
|
||||
|
|
|
|||
31
tools/pullYMLtoLDBBuild.mjs
Normal file
31
tools/pullYMLtoLDBBuild.mjs
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue