Socket
Socket
Sign inDemoInstall

bin-build

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bin-build - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

license

66

index.js
'use strict';
var fs = require('fs');
var archiveType = require('archive-type');

@@ -7,4 +8,3 @@ var execSeries = require('exec-series');

var Download = require('download');
var read = require('fs').readFile;
var rm = require('rimraf');
var rimraf = require('rimraf');
var tempfile = require('tempfile');

@@ -27,6 +27,7 @@ var urlRegex = require('url-regex');

this.opts.strip = this.opts.strip <= 0 ? 0 : !this.opts.strip ? 1 : this.opts.strip;
this._cmd = [];
this._tmp = tempfile();
this.tmp = tempfile();
}
module.exports = BinBuild;
/**

@@ -60,3 +61,5 @@ * Define the source archive to download

this._cmd = this._cmd || [];
this._cmd.push(str);
return this;

@@ -74,6 +77,5 @@ };

cb = cb || function () {};
var self = this;
if (urlRegex().test(this.src())) {
return this.get(function (err) {
return this.download(function (err) {
if (err) {

@@ -84,7 +86,7 @@ cb(err);

self.exec(self._tmp, cb);
});
this.exec(this.tmp, cb);
}.bind(this));
}
read(this.src(), function (err, data) {
fs.readFile(this.src(), function (err, data) {
if (err && err.code !== 'EISDIR') {

@@ -96,3 +98,3 @@ cb(err);

if (archiveType(data)) {
return self.decompress(function (err) {
return this.extract(function (err) {
if (err) {

@@ -103,8 +105,8 @@ cb(err);

self.exec(self._tmp, cb);
});
this.exec(this.tmp, cb);
}.bind(this));
}
self.exec(self.src(), cb);
});
this.exec(this.src(), cb);
}.bind(this));
};

@@ -121,7 +123,5 @@

BinBuild.prototype.exec = function (cwd, cb) {
var self = this;
execSeries(this.cmd(), { cwd: cwd }, function (err) {
execSeries(this.cmd(), {cwd: cwd}, function (err) {
if (err) {
err.message = [self.cmd().join(' && '), err.message].join('\n');
err.message = [this.cmd().join(' && '), err.message].join('\n');
cb(err);

@@ -131,4 +131,4 @@ return;

rm(self._tmp, cb);
});
rimraf(this.tmp, cb);
}.bind(this));
};

@@ -143,3 +143,3 @@

BinBuild.prototype.decompress = function (cb) {
BinBuild.prototype.extract = function (cb) {
var decompress = new Decompress({

@@ -150,9 +150,10 @@ mode: '777',

decompress.src(this.src());
decompress.dest(this._tmp);
decompress.run(cb);
decompress
.src(this.src())
.dest(this.tmp)
.run(cb);
};
/**
* Download source
* Download source file
*

@@ -163,3 +164,3 @@ * @param {Function} cb

BinBuild.prototype.get = function (cb) {
BinBuild.prototype.download = function (cb) {
var download = new Download({

@@ -171,11 +172,6 @@ strip: this.opts.strip,

download.get(this.src());
download.dest(this._tmp);
download.run(cb);
download
.get(this.src())
.dest(this.tmp)
.run(cb);
};
/**
* Module exports
*/
module.exports = BinBuild;
{
"name": "bin-build",
"version": "2.1.1",
"version": "2.1.2",
"description": "Easily build binaries",

@@ -29,3 +29,3 @@ "license": "MIT",

"decompress": "^2.1.1",
"download": "^3.1.0",
"download": "^4.1.2",
"exec-series": "^1.0.0",

@@ -38,4 +38,4 @@ "rimraf": "^2.2.6",

"ava": "^0.0.4",
"nock": "^0.56.0"
"nock": "^2.6.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc