Socket
Socket
Sign inDemoInstall

bin-build

Package Overview
Dependencies
116
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 1.0.0

28

index.js
'use strict';
var exec = require('child_process').exec;
var Download = require('download');
var rm = require('rimraf');

@@ -61,17 +62,24 @@ var tempfile = require('tempfile');

BinBuild.prototype.build = function (cb) {
var download = require('download');
cb = cb || function () {};
var str = this.cmd().join(' && ');
var tmp = tempfile();
var download = new Download({ strip: 1, extract: true })
.get(this.src(), tmp);
download(this.src(), tmp, { strip: 1, extract: true })
.on('error', cb)
.on('close', function () {
exec(str, { cwd: tmp }, function (err) {
if (err) {
return cb(err);
}
download.run(function (err) {
if (err) {
cb(err);
return;
}
rm(tmp, cb);
});
exec(str, { cwd: tmp }, function (err) {
if (err) {
cb(err);
return;
}
rm(tmp, cb);
});
});
};

@@ -78,0 +86,0 @@

{
"name": "bin-build",
"version": "0.2.0",
"version": "1.0.0",
"description": "Easily build binaries",

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

"scripts": {
"test": "mocha --reporter list --timeout 75000"
"test": "node test.js"
},

@@ -28,9 +28,9 @@ "files": [

"dependencies": {
"download": "^0.1.16",
"download": "^1.0.2",
"rimraf": "^2.2.6",
"tempfile": "^0.1.3"
"tempfile": "^1.0.0"
},
"devDependencies": {
"mocha": "^1.18.2"
"ava": "^0.0.4"
}
}

@@ -15,15 +15,15 @@ # bin-build [![Build Status](https://travis-ci.org/kevva/bin-build.svg?branch=master)](https://travis-ci.org/kevva/bin-build)

var BinBuild = require('bin-build');
var build = new BinBuild();
build
var build = new BinBuild()
.src('http://www.lcdf.org/gifsicle/gifsicle-1.80.tar.gz')
.cmd('./configure --disable-gifview --disable-gifdiff')
.cmd('make install')
.build(function (err) {
if (err) {
throw err;
}
.cmd('make install');
console.log('gifsicle built successfully');
});
build.build(function (err) {
if (err) {
throw err;
}
console.log('gifsicle built successfully');
});
```

@@ -47,3 +47,3 @@

Runs the build.
Runs the build and returns an error if something has gone wrong

@@ -50,0 +50,0 @@ ## License

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc