BetterDiscordApp-rauenzi/scripts/pack.js

23 lines
751 B
JavaScript
Raw Normal View History

const path = require("path");
const asar = require("asar");
const doSanityChecks = require("./validate");
const buildPackage = require("./package");
2021-04-08 02:31:02 +02:00
const dist = path.resolve(__dirname, "..", "dist");
const bundleFile = path.join(dist, "betterdiscord.asar");
const makeBundle = function() {
console.log("");
console.log("Generating bundle");
2021-04-08 02:31:02 +02:00
asar.createPackageFromFiles(dist, bundleFile, ["dist/injector.js", "dist/package.json", "dist/preload.js", "dist/renderer.js"]).then(() => {
console.log(` ✅ Successfully created bundle ${bundleFile}`);
}).catch(err => {
console.log(` ❌ Could not build bundle: ${err.message}`);
});
};
doSanityChecks(dist);
buildPackage(dist);
2021-04-08 02:31:02 +02:00
// cleanOldAsar();
makeBundle();