This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
/
build.ts
69 lines (57 loc) · 1.36 KB
/
build.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env node
import * as yargs from 'yargs';
const debug = require('debug')('build:commandline:build');
import { Builder } from '../lib';
const argv = require('yargs')
.option('x86', {
type: 'boolean',
describe: 'Build for x86 arch',
default: Builder.DEFAULT_OPTIONS.x86,
})
.option('x64', {
type: 'boolean',
describe: 'Build for x64 arch',
default: Builder.DEFAULT_OPTIONS.x64,
})
.option('win', {
type: 'boolean',
describe: 'Build for Windows platform',
default: Builder.DEFAULT_OPTIONS.win,
alias: 'w',
})
.option('mac', {
type: 'boolean',
describe: 'Build for macOS platform',
default: Builder.DEFAULT_OPTIONS.mac,
alias: 'm',
})
.option('linux', {
type: 'boolean',
describe: 'Build for Linux platform',
default: Builder.DEFAULT_OPTIONS.linux,
alias: 'l',
})
.option('mirror', {
describe: 'Modify NW.js mirror',
default: Builder.DEFAULT_OPTIONS.mirror,
})
.help()
.argv;
(async () => {
debug('in commandline', 'argv', argv);
const builder = new Builder({
win: argv.win,
mac: argv.mac,
linux: argv.linux,
x86: argv.x86,
x64: argv.x64,
mirror: argv.mirror,
mute: false,
}, argv._.shift());
await builder.build();
process.exitCode = 0;
})()
.catch((err) => {
console.error(err);
process.exitCode = -1;
});