forked from Andy-K-Sparklight/Alicorn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eliminate.js
36 lines (35 loc) · 1.02 KB
/
eliminate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const fs = require("fs-extra");
let OUTPUT_DIRS = [
"out/Alicorn-linux-x64",
"out/Alicorn-win32-ia32",
"out/Alicorn-win32-x64",
"out/Alicorn-linux-arm64",
];
const path = require("path");
async function eliminateExtraFiles() {
try {
await Promise.allSettled(
OUTPUT_DIRS.map(async (d) => {
let tLocales = path.join(d, "locales");
let a = await fs.readdir(tLocales);
await Promise.allSettled(
a.map(async (f) => {
if (f !== "en-US.pak") {
await fs.remove(path.join(tLocales, f));
}
})
);
await fs.remove(path.join(d, "chrome_crashpad_handler"));
await fs.remove(path.join(d, "chrome_100_percent.pak"));
await fs.remove(path.join(d, "chrome_200_percent.pak"));
await fs.remove(path.join(d, "LICENSES.chromium.html"));
await fs.remove(path.join(d, "LICENSE"));
})
);
} catch {}
}
eliminateExtraFiles()
.then(() => {
console.log("Eliminated extra files!");
})
.catch(() => {});