Comparing version 2.6.0 to 2.6.1
{ | ||
"name": "prebuild", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"description": "A command line tool for easily doing prebuilds for multiple version of node/iojs on a specific platform", | ||
"scripts": { | ||
"test": "standard && tape test/*-test.js" | ||
"test": "tape test/*-test.js && standard" | ||
}, | ||
@@ -28,3 +28,4 @@ "dependencies": { | ||
"standard": "~5.3.1", | ||
"tape": "^4.0.1" | ||
"tape": "^4.0.1", | ||
"xtend": "^4.0.0" | ||
}, | ||
@@ -31,0 +32,0 @@ "bin": { |
26
rc.js
var minimist = require('minimist') | ||
if (process.env.npm_config_argv) { | ||
var npmargs = [ | ||
'compile', | ||
'no-build-from-source', | ||
'debug' | ||
] | ||
var npmargs = ['compile', 'build-from-source', 'debug'] | ||
try { | ||
@@ -20,14 +16,10 @@ var npm_argv = JSON.parse(process.env.npm_config_argv).cooked | ||
} catch (e) { } | ||
} | ||
var npmconfigs = [ | ||
'proxy', | ||
'https-proxy', | ||
'local-address' | ||
] | ||
for (var j = 0; j < npmconfigs.length; ++j) { | ||
var envname = 'npm_config_' + npmconfigs[j].replace('-', '_') | ||
if (process.env[envname]) { | ||
process.argv.push('--' + npmconfigs[j]) | ||
process.argv.push(process.env[envname]) | ||
} | ||
var npmconfigs = ['proxy', 'https-proxy', 'local-address'] | ||
for (var j = 0; j < npmconfigs.length; ++j) { | ||
var envname = 'npm_config_' + npmconfigs[j].replace('-', '_') | ||
if (process.env[envname]) { | ||
process.argv.push('--' + npmconfigs[j]) | ||
process.argv.push(process.env[envname]) | ||
} | ||
@@ -62,3 +54,3 @@ } | ||
if (!module.parent) { | ||
console.log('%j', module.exports) | ||
console.log(JSON.stringify(module.exports, null, 2)) | ||
} |
@@ -16,2 +16,3 @@ # prebuild | ||
* Support for downloading (`--download`) prebuilds from GitHub. You can also download from a host of your choice and you can customize the url format as you see fit. | ||
* Downloaded binaries will be cached in `~/.npm/_prebuilds/` so you only need to download them once. | ||
* Support for stripping (`--strip`) debug information. | ||
@@ -18,0 +19,0 @@ |
var test = require('tape') | ||
var path = require('path') | ||
var exec = require('child_process').exec | ||
var xtend = require('xtend') | ||
@@ -21,3 +22,3 @@ test('custom config and aliases', function (t) { | ||
] | ||
runRc(t, args.join(' '), function (rc) { | ||
runRc(t, args.join(' '), {}, function (rc) { | ||
t.equal(rc.arch, 'ARCH', 'correct arch') | ||
@@ -47,5 +48,38 @@ t.equal(rc.arch, rc.a) | ||
function runRc (t, args, cb) { | ||
test('npm args are passed on from npm environment into rc', function (t) { | ||
var env = { | ||
npm_config_argv: JSON.stringify({ | ||
cooked: [ | ||
'--compile', | ||
'--build-from-source', | ||
'--debug' | ||
] | ||
}) | ||
} | ||
runRc(t, '', env, function (rc) { | ||
t.equal(rc['build-from-source'], true, '--build-from-source works') | ||
t.equal(rc.compile, true, 'compile should be true') | ||
t.equal(rc.debug, true, 'debug should be true') | ||
t.end() | ||
}) | ||
}) | ||
test('npm_config_* are passed on from environment into rc', function (t) { | ||
var env = { | ||
npm_config_proxy: 'PROXY', | ||
npm_config_https_proxy: 'HTTPS_PROXY', | ||
npm_config_local_address: 'LOCAL_ADDRESS' | ||
} | ||
runRc(t, '', env, function (rc) { | ||
t.equal(rc.proxy, 'PROXY', 'proxy is set') | ||
t.equal(rc['https-proxy'], 'HTTPS_PROXY', 'https-proxy is set') | ||
t.equal(rc['local-address'], 'LOCAL_ADDRESS', 'local-address is set') | ||
t.end() | ||
}) | ||
}) | ||
function runRc (t, args, env, cb) { | ||
var cmd = 'node ' + path.resolve(__dirname, '..', 'rc.js') + ' ' + args | ||
exec(cmd, function (err, stdout, stderr) { | ||
env = xtend(process.env, env) | ||
exec(cmd, { env: env }, function (err, stdout, stderr) { | ||
t.error(err, 'no error') | ||
@@ -52,0 +86,0 @@ t.equal(stderr.length, 0, 'no stderr') |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
64545
1711
143
5
24