prebuildify
Advanced tools
Comparing version 5.0.1 to 6.0.0
@@ -8,2 +8,3 @@ #!/usr/bin/env node | ||
alias: { | ||
name: 'n', | ||
target: 't', | ||
@@ -21,3 +22,6 @@ version: 'v', | ||
}, | ||
boolean: ['quiet', 'strip', 'napi', 'debug', 'all', 'electron-compat'] | ||
boolean: ['quiet', 'strip', 'napi', 'debug', 'all', 'electron-compat'], | ||
default: { | ||
napi: true | ||
} | ||
}) | ||
@@ -24,0 +28,0 @@ |
34
index.js
@@ -70,9 +70,12 @@ var proc = require('child_process') | ||
mkdirp(opts.builds, function (err) { | ||
addName(opts, function (err) { | ||
if (err) return cb(err) | ||
loop(opts, function (err) { | ||
mkdirp(opts.builds, function (err) { | ||
if (err) return cb(err) | ||
loop(opts, function (err) { | ||
if (err) return cb(err) | ||
if (opts.artifacts) return copyRecursive(opts.artifacts, opts.builds, cb) | ||
return cb() | ||
if (opts.artifacts) return copyRecursive(opts.artifacts, opts.builds, cb) | ||
return cb() | ||
}) | ||
}) | ||
@@ -112,8 +115,23 @@ }) | ||
function addName (opts, cb) { | ||
if (opts.name) return cb() | ||
fs.readFile(path.join(opts.cwd, 'package.json'), 'utf-8', function (err, pkg) { | ||
if (err) return cb() | ||
try { | ||
opts.name = JSON.parse(pkg).name | ||
} catch (err) { | ||
// do nothing | ||
} | ||
cb() | ||
}) | ||
} | ||
function encodeName (name) { | ||
return name.replace(/\//g, '+') | ||
} | ||
function prebuildName (target, opts) { | ||
var tags = [target.runtime] | ||
var tags = [encodeName(opts.name || target.runtime)] | ||
if (opts.napi) { | ||
tags.push('napi') | ||
} else { | ||
if (!opts.napi) { | ||
tags.push('abi' + abi.getAbi(target.target, target.runtime)) | ||
@@ -120,0 +138,0 @@ } |
{ | ||
"name": "prebuildify", | ||
"version": "5.0.1", | ||
"version": "6.0.0", | ||
"description": "Create and package prebuilds for native modules", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20596
325