forked from prebuild/prebuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrc.js
More file actions
69 lines (60 loc) · 1.27 KB
/
Copy pathrc.js
File metadata and controls
69 lines (60 loc) · 1.27 KB
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
var minimist = require('minimist')
var targets = require('node-abi').supportedTargets
var detectLibc = require('detect-libc')
var libc = process.env.LIBC || (detectLibc.isNonGlibcLinux && detectLibc.family) || ''
var rc = require('rc')('prebuild', {
target: process.versions.node,
runtime: 'node',
arch: process.arch,
libc: libc,
platform: process.platform,
all: false,
force: false,
debug: false,
verbose: false,
path: '.',
backend: 'node-gyp',
format: false,
'include-regex': '\\.node$'
}, minimist(process.argv, {
alias: {
target: 't',
runtime: 'r',
help: 'h',
arch: 'a',
path: 'p',
force: 'f',
version: 'v',
upload: 'u',
preinstall: 'i',
prepack: 'c'
},
string: [
'target'
]
}))
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']
}
rc['include-regex'] = new RegExp(rc['include-regex'], 'i')
module.exports = rc
if (!module.parent) {
console.log(JSON.stringify(module.exports, null, 2))
}