Comparing version 0.4.1 to 0.4.2
31
index.js
@@ -21,6 +21,8 @@ var child_process = require('child_process'), | ||
function bufferedExec(cmd, args, opts, callback) { | ||
var args = args || [], | ||
err = '', | ||
var err = '', | ||
out = ''; | ||
if (args == null) | ||
args = []; | ||
// stream to capture stdout | ||
@@ -119,6 +121,8 @@ stdout = new Stream(); | ||
function quietExec(cmd, args, opts, callback) { | ||
var args = args || [], | ||
err = '', | ||
var err = '', | ||
out = ''; | ||
if (args == null) | ||
args = []; | ||
var child = child_process.spawn(cmd, args, opts); | ||
@@ -238,6 +242,2 @@ | ||
if (typeof opts.safe === 'undefined') { | ||
opts.safe = true; | ||
} | ||
if (!callback) { | ||
@@ -254,13 +254,16 @@ callback = function() {}; | ||
return exec(cmds[complete], opts, function(err, stdout, stderr, code) { | ||
errBuf += stderr; | ||
outBuf += stdout; | ||
if (opts.safe && code !== 0) { | ||
return callback(errBuf, outBuf, code); | ||
if ((err != null) || (code !== 0)) { | ||
return callback(err, outBuf, errBuf, code); | ||
} | ||
if ((stderr != null) && (stderr !== '')) | ||
errBuf += stderr; | ||
if ((stdout != null) && (stdout !== '')) | ||
outBuf += stdout; | ||
complete++; | ||
if (complete === cmds.length) { | ||
callback(errBuf, outBuf, code); | ||
callback(err, outBuf, errBuf, code); | ||
} else { | ||
@@ -267,0 +270,0 @@ iterate(); |
{ | ||
"name": "executive", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "exec for the lazy", | ||
@@ -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
13120
305