Comparing version 6.1.7 to 6.1.8
"use strict"; | ||
const cp = require('child_process'); | ||
const once = require('../function/once'); | ||
const {spawn} = require('child_process'); | ||
const wait = require('./wait'); | ||
module.exports = function(cmd, args = [], options = {}) { | ||
if(!Array.isArray(args)) | ||
(options = args), (args = options.args || []); | ||
module.exports = function(cmd /*, options, chain*/) { | ||
var args = Array.from(arguments); | ||
var chain = once(args.pop()); | ||
cmd = args.shift(); | ||
var options = args.shift() || {}; | ||
if(Array.isArray(options)) | ||
options = { args : options}; | ||
options.stdio = ['inherit', 'inherit', 'inherit']; | ||
try { | ||
var ps = cp.spawn(cmd, options.args || [], options); | ||
ps.on('error', chain); | ||
ps.on('close', function(exit) { | ||
var err = null; | ||
if(exit !== 0) | ||
err = "Bad exit code " + exit; | ||
return chain(err, exit); | ||
}); | ||
} catch(err) { | ||
chain(err); | ||
} | ||
options.stdio = 'inherit'; | ||
var child = spawn(cmd, args, options); | ||
return wait(child); | ||
}; | ||
{ | ||
"name": "nyks", | ||
"version": "6.1.7", | ||
"version": "6.1.8", | ||
"description": "nodejs exupery style", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -8,2 +8,5 @@ "use strict"; | ||
/* eslint no-prototype-builtins: "off" */ | ||
/* istanbul ignore file */ | ||
const kindOf = require('mout/lang/kindOf'); | ||
@@ -34,3 +37,2 @@ const repeat = require('../string/repeat'); | ||
/* istanbul ignore next */ | ||
sprintf.format = function(parse_tree, argv) { | ||
@@ -37,0 +39,0 @@ var cursor = 1; |
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
72523
1912