Merge e37016c191
into 78edeb77c6
This commit is contained in:
commit
9ce9c14415
|
@ -1,18 +1,21 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs").promises;
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
module.exports = function(dist) {
|
module.exports = async function checkBuildValidity(dist) {
|
||||||
console.log("");
|
|
||||||
console.log("Ensuring build validity");
|
console.log("Ensuring build validity");
|
||||||
const files = [
|
const files = [
|
||||||
path.join(dist, "injector.js"),
|
"injector.js",
|
||||||
path.join(dist, "preload.js"),
|
"preload.js",
|
||||||
path.join(dist, "renderer.js")
|
"renderer.js"
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const exists = fs.existsSync(file);
|
const filePath = path.join(dist, file);
|
||||||
if (!exists) throw new Error(` ❌ File missing: ${file}`);
|
try {
|
||||||
console.log(` ✅ Found ${file}`);
|
await fs.access(filePath);
|
||||||
|
console.log(`✅ Found ${filePath}`);
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`❌ File missing: ${filePath}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue