-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.ts
33 lines (27 loc) · 809 Bytes
/
bundle.ts
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
import { execSync } from "child_process";
import * as utils from "./utils";
(function () {
const args: Set<string> = new Set();
for (let i = 2; i < process.argv.length; i++) {
const arg = process.argv[i];
console.log(`${i}: ${arg}`);
args.add(arg);
}
const projectConfig = utils.fetchProjectConfig();
if (args.has("-minify"))
projectConfig.minifyScripts = true;
if (args.has("-archive"))
projectConfig.buildArchive = true;
console.info('Bundling mod...')
const modBundled = utils.bundleMod(projectConfig);
if (!modBundled) {
console.error(`Failed to bundle mod.`);
return;
}
console.info('Installing mod...')
const modInstalled = utils.installMod(projectConfig);
if (!modInstalled) {
console.error(`Failed to install mod.`)
return;
}
})();