armcord/scripts/fixBundles.js
smartfridge 1da43a6575
move shelter plugins into the main repo (#688)
* wip: local shelter plugins

* serve plugins over armcord protocol

* remove useless comments

* remove use strict from bundles before sending them

* update lockfile

* lint

* check for path escape

* add fix bundle script

* format script

* remove unused imports
2024-08-18 18:00:36 +02:00

9 lines
388 B
JavaScript

import fs from "fs";
import path from "path";
const pathToPlugins = path.join(import.meta.dirname, "..", "ts-out", "plugins");
console.log(pathToPlugins);
fs.readdirSync(pathToPlugins).forEach((file) => {
const bundle = fs.readFileSync(`${pathToPlugins}/${file}/plugin.js`, "utf8");
fs.writeFileSync(`${pathToPlugins}/${file}/plugin.js`, bundle.replace(/.*/, "").substr(1));
});