2024-05-16 17:57:51 +02:00
|
|
|
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()
|
|
|
|
{
|
2024-05-17 01:07:37 +02:00
|
|
|
mergeObject(game.wfrp4e.config.effectScripts, ${JSON.stringify(scriptObj)});
|
2024-05-16 17:57:51 +02:00
|
|
|
|
|
|
|
}`
|
|
|
|
|
|
|
|
fs.writeFileSync("./loadScripts.js", scriptLoader)
|
|
|
|
console.log(`Packed ${count} scripts`);
|