forked from public/foundryvtt-wh4-lang-fr-fr
Add all systems effects scripts
This commit is contained in:
24
scriptPacker.js
Normal file
24
scriptPacker.js
Normal file
@ -0,0 +1,24 @@
|
||||
import fs from "fs";
|
||||
|
||||
let path = "./scripts/"
|
||||
let scripts = fs.readdirSync(path);
|
||||
let count = 0;
|
||||
let scriptObj = {};
|
||||
for(let file of scripts)
|
||||
{
|
||||
let script = fs.readFileSync(path + file, {encoding:"utf8"});
|
||||
scriptObj[file.split(".")[0]] = script;
|
||||
count++;
|
||||
}
|
||||
|
||||
let scriptLoader = `export default function()
|
||||
{
|
||||
Hooks.on("init", () =>
|
||||
{
|
||||
mergeObject(game.wfrp4e.config.effectScripts, ${JSON.stringify(scriptObj)});
|
||||
});
|
||||
|
||||
}`
|
||||
|
||||
fs.writeFileSync("./loadScripts.js", scriptLoader)
|
||||
console.log(`Packed ${count} scripts`);
|
Reference in New Issue
Block a user