-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
36 lines (32 loc) · 992 Bytes
/
index.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");
const path = require("path");
const { exec } = require("child_process");
const { zip } = require("zip-a-folder");
const accPath = path.join(__dirname, "./acc");
const acsPath = path.join(__dirname, "./outcast/acs");
const acsFiles =
fs.readdirSync(acsPath)?.filter((file) => file.endsWith(".acs")) ?? [];
async function build() {
await Promise.allSettled(
acsFiles.map(
(file) =>
new Promise((resolve) => {
const filePath = path.join(acsPath, file);
exec(
`acc.exe ${filePath} ${filePath.replace(".acs", ".o")}`,
{ cwd: accPath },
(err, stdout, stderr) => {
if (err) {
console.log(err);
}
resolve();
// console.log(stdout);
// console.log(stderr);
}
);
})
)
);
await zip(path.join(__dirname, "/outcast"), path.join(__dirname, "/dist/outcast.pk3"));
}
build();