Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (rc.help) {
console.error(fs.readFileSync(path.join(__dirname, 'help.txt'), 'utf-8'))
process.exit(0)
}
log.info('begin', 'Prebuild version', prebuildVersion)
// nvm! do not mess with headers? kkthx!
delete process.env.NVM_IOJS_ORG_MIRROR
delete process.env.NVM_NODEJS_ORG_MIRROR
var buildLog = log.info.bind(log, 'build')
var opts = Object.assign({}, rc, { pkg: pkg, log: log, buildLog: buildLog, argv: process.argv })
if (napi.isNapiRuntime(rc.runtime)) napi.logMissingNapiVersions(rc.target, rc.prebuild, log)
if (opts['upload-all']) {
fs.readdir('prebuilds', function (err, pbFiles) {
if (err) return onbuilderror(err)
uploadFiles(pbFiles.map(function (file) { return 'prebuilds/' + file }))
})
} else {
var files = []
eachSeries(opts.prebuild, function (target, next) {
prebuild(opts, target.target, target.runtime, function (err, tarGz) {
if (err) return next(err)
files.push(tarGz)
next()
})
}, function (err) {
if (err) return onbuilderror(err)