2021-03-06 09:30:16 +01:00
|
|
|
const path = require("path");
|
|
|
|
const asar = require("asar");
|
|
|
|
|
2021-03-06 21:26:48 +01:00
|
|
|
const doSanityChecks = require("./validate");
|
|
|
|
const buildPackage = require("./package");
|
|
|
|
|
2021-04-08 02:31:02 +02:00
|
|
|
const dist = path.resolve(__dirname, "..", "dist");
|
2021-03-06 09:30:16 +01:00
|
|
|
const bundleFile = path.join(dist, "betterdiscord.asar");
|
|
|
|
|
|
|
|
const makeBundle = function() {
|
2021-03-06 21:26:48 +01:00
|
|
|
console.log("");
|
2021-03-06 09:30:16 +01:00
|
|
|
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(() => {
|
2021-03-06 09:30:16 +01:00
|
|
|
console.log(` ✅ Successfully created bundle ${bundleFile}`);
|
|
|
|
}).catch(err => {
|
|
|
|
console.log(` ❌ Could not build bundle: ${err.message}`);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2021-03-06 21:26:48 +01:00
|
|
|
doSanityChecks(dist);
|
|
|
|
buildPackage(dist);
|
2021-04-08 02:31:02 +02:00
|
|
|
// cleanOldAsar();
|
2021-03-06 09:30:16 +01:00
|
|
|
makeBundle();
|