forked from prebuild/prebuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc.js
58 lines (51 loc) · 1 KB
/
rc.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
var minimist = require('minimist')
var targets = require('node-abi').allTargets
var rc = require('rc')('prebuild', {
target: process.versions.node,
runtime: 'node',
arch: process.arch,
libc: process.env.LIBC,
platform: process.platform,
all: false,
force: false,
debug: false,
verbose: false,
path: '.',
backend: 'node-gyp'
}, minimist(process.argv, {
alias: {
target: 't',
runtime: 'r',
help: 'h',
arch: 'a',
path: 'p',
force: 'f',
version: 'v',
upload: 'u',
preinstall: 'i'
}
}))
if (rc.path === true) {
delete rc.path
}
if (rc.target) {
var arr = [].concat(rc.target)
rc.prebuild = []
for (var k = 0, len = arr.length; k < len; k++) {
rc.prebuild.push({
runtime: rc.runtime,
target: arr[k]
})
}
}
if (rc.all === true) {
delete rc.prebuild
rc.prebuild = targets
}
if (rc['upload-all']) {
rc.upload = rc['upload-all']
}
module.exports = rc
if (!module.parent) {
console.log(JSON.stringify(module.exports, null, 2))
}