Comparing version 1.5.12 to 1.5.13
@@ -5,49 +5,22 @@ 'use strict'; | ||
var child_process = require('child_process'); | ||
var Stream = _interopDefault(require('stream')); | ||
var fs = _interopDefault(require('fs')); | ||
var path = _interopDefault(require('path')); | ||
var child_process = require('child_process'); | ||
// node_modules/es-tostring/index.mjs | ||
var toString = function(obj) { | ||
function toString(obj) { | ||
return Object.prototype.toString.call(obj) | ||
}; | ||
} | ||
// node_modules/es-hasown/index.mjs | ||
var hasOwn = function(obj, prop) { | ||
return {}.hasOwnProperty.call(obj, prop) | ||
}; | ||
// node_modules/es-is/bool.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isBool; | ||
var isBool$1 = isBool = function(value) { | ||
return toString(value) === '[object Boolean]'; | ||
}; | ||
// node_modules/es-is/infinite.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isInfinite; | ||
var isInfinite$1 = isInfinite = function(value) { | ||
return value === 2e308 || value === -2e308; | ||
}; | ||
// node_modules/es-is/number.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isNumber; | ||
var isNumber$1 = isNumber = function(value) { | ||
return toString(value) === '[object Number]'; | ||
}; | ||
// node_modules/es-is/array-like.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isArrayLike; | ||
var isArrayLike$1 = isArrayLike = function(value) { | ||
return !!value && !isBool$1(value) && hasOwn(value, 'length') && isFinite(value.length) && isNumber$1(value.length) && value.length >= 0; | ||
}; | ||
// node_modules/es-is/array.js | ||
@@ -83,20 +56,5 @@ // Generated by CoffeeScript 1.12.5 | ||
// node_modules/es-is/arguments.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isArguments; | ||
var isArguments$1 = isArguments = function(value) { | ||
var isOldArguments, isStandardArguments; | ||
isStandardArguments = toString(value) === '[object Arguments]'; | ||
isOldArguments = !isArray$1(value) && isArrayLike$1(value) && isObject$1(value) && isFunction$1(value.callee); | ||
return isStandardArguments || isOldArguments; | ||
}; | ||
// node_modules/es-is/async-function.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isAsyncFunction; | ||
isAsyncFunction = function(value) { | ||
return toString(value) === '[object AsyncFunction]'; | ||
}; | ||
// node_modules/es-is/string.js | ||
@@ -111,365 +69,63 @@ // Generated by CoffeeScript 1.12.5 | ||
// node_modules/es-is/base64.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var base64Regex; | ||
var isBase64; | ||
base64Regex = /^([A-Za-z0-9+\/]{4})*([A-Za-z0-9+\/]{4}|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)$/; | ||
isBase64 = function(value) { | ||
return isString$1(value) && (!value.length || base64Regex.test(value)); | ||
}; | ||
// node_modules/es-is/date.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isDate; | ||
var isDate$1 = isDate = function(value) { | ||
return toString(value) === '[object Date]'; | ||
}; | ||
// node_modules/es-is/utils.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isActualNaN = function(value) { | ||
return value !== value; | ||
}; | ||
// node_modules/es-is/decimal.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isDecimal; | ||
isDecimal = function(value) { | ||
return isNumber$1(value) && !isActualNaN(value) && !isInfinite$1(value) && value % 1 !== 0; | ||
}; | ||
// node_modules/es-is/defined.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isDefined; | ||
isDefined = function(value) { | ||
return typeof value !== 'undefined'; | ||
}; | ||
// node_modules/es-is/divisible-by.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isDivisibleBy; | ||
isDivisibleBy = function(value, n) { | ||
var isDividendInfinite, isDivisorInfinite, isNonZeroNumber; | ||
isDividendInfinite = isInfinite$1(value); | ||
isDivisorInfinite = isInfinite$1(n); | ||
isNonZeroNumber = isNumber$1(value) && !isActualNaN(value) && isNumber$1(n) && !isActualNaN(n) && n !== 0; | ||
return isDividendInfinite || isDivisorInfinite || isNonZeroNumber && value % n === 0; | ||
}; | ||
// node_modules/es-is/element.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isElement; | ||
isElement = function(value) { | ||
return value !== void 0 && typeof HTMLElement !== 'undefined' && value instanceof HTMLElement && value.nodeType === 1; | ||
}; | ||
// node_modules/es-is/empty-arguments.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isEmptyArguments; | ||
isEmptyArguments = function(value) { | ||
return isArguments$1(value) && value.length === 0; | ||
}; | ||
// node_modules/es-is/empty-array.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isEmptyArray; | ||
isEmptyArray = function(value) { | ||
return isArray$1(value) && value.length === 0; | ||
}; | ||
// node_modules/es-is/empty.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isEmpty; | ||
isEmpty = function(value) { | ||
var key, type; | ||
type = toString(value); | ||
if (type === '[object Array]' || type === '[object Arguments]' || type === '[object String]') { | ||
return value.length === 0; | ||
} | ||
if (type === '[object Object]') { | ||
for (key in value) { | ||
if (hasOwn(value, key)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
return !value; | ||
}; | ||
// node_modules/es-is/equal.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isEqual; | ||
isEqual = function(value, other) { | ||
var key, type; | ||
if (value === other) { | ||
return true; | ||
} | ||
type = toString(value); | ||
if (type !== toString(other)) { | ||
return false; | ||
} | ||
if (type === '[object Object]') { | ||
for (key in value) { | ||
if (!isEqual(value[key], other[key]) || !(key in other)) { | ||
return false; | ||
} | ||
} | ||
for (key in other) { | ||
if (!isEqual(value[key], other[key]) || !(key in value)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
if (type === '[object Array]') { | ||
key = value.length; | ||
if (key !== other.length) { | ||
return false; | ||
} | ||
while (key--) { | ||
if (!isEqual(value[key], other[key])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
if (type === '[object Function]') { | ||
return value.prototype === other.prototype; | ||
} | ||
if (type === '[object Date]') { | ||
return value.getTime() === other.getTime(); | ||
} | ||
return false; | ||
}; | ||
// node_modules/es-is/error.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isError; | ||
isError = function(value) { | ||
return toString(value) === '[object Error]'; | ||
}; | ||
// node_modules/es-is/even.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isEven; | ||
isEven = function(value) { | ||
return isInfinite$1(value) || isNumber$1(value) && value === value && value % 2 === 0; | ||
}; | ||
// node_modules/es-is/false.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isFalse; | ||
isFalse = function(value) { | ||
return isBool$1(value) && Boolean(Number(value)) === false; | ||
}; | ||
// node_modules/es-is/generator-function.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isGeneratorFunction; | ||
isGeneratorFunction = function(value) { | ||
return toString(value) === '[object GeneratorFunction]'; | ||
}; | ||
// node_modules/es-is/generator.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isGenerator; | ||
isGenerator = function(value) { | ||
return (isFunction$1(typeof g !== "undefined" && g !== null ? g.next : void 0)) && (isFunction$1(g["throw"])); | ||
}; | ||
// node_modules/es-is/ge.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isGe; | ||
isGe = function(value, other) { | ||
if (isActualNaN(value) || isActualNaN(other)) { | ||
throw new TypeError('NaN is not a valid value'); | ||
} | ||
return !isInfinite$1(value) && !isInfinite$1(other) && value >= other; | ||
}; | ||
// node_modules/es-is/gt.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isGt; | ||
isGt = function(value, other) { | ||
if (isActualNaN(value) || isActualNaN(other)) { | ||
throw new TypeError('NaN is not a valid value'); | ||
} | ||
return !isInfinite$1(value) && !isInfinite$1(other) && value > other; | ||
}; | ||
// node_modules/es-is/hash.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isHash; | ||
isHash = function(value) { | ||
return isObject$1(value) && value.constructor === Object && !value.nodeType && !value.setInterval; | ||
}; | ||
// node_modules/es-is/hex.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var hexRegex; | ||
var isHex; | ||
hexRegex = /^[A-Fa-f0-9]+$/; | ||
isHex = function(value) { | ||
return isString$1(value) && (!value.length || hexRegex.test(value)); | ||
}; | ||
// node_modules/es-is/hosted.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var NON_HOST_TYPES; | ||
var isHosted; | ||
NON_HOST_TYPES = { | ||
'boolean': 1, | ||
number: 1, | ||
string: 1, | ||
undefined: 1 | ||
}; | ||
isHosted = function(value, host) { | ||
var type; | ||
type = typeof host[value]; | ||
if (type === 'object') { | ||
return !!host[value]; | ||
} else { | ||
return !NON_HOST_TYPES[type]; | ||
} | ||
}; | ||
// node_modules/es-is/instanceof.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isInstanceOf; | ||
isInstanceOf = function(value, constructor) { | ||
return value instanceof constructor; | ||
}; | ||
// node_modules/es-is/integer.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isInteger; | ||
isInteger = function(value) { | ||
return isNumber$1(value) && !isActualNaN(value) && value % 1 === 0; | ||
}; | ||
// node_modules/es-is/le.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isLe; | ||
isLe = function(value, other) { | ||
if (isActualNaN(value) || isActualNaN(other)) { | ||
throw new TypeError('NaN is not a valid value'); | ||
} | ||
return !isInfinite$1(value) && !isInfinite$1(other) && value <= other; | ||
}; | ||
// node_modules/es-is/lt.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isLt; | ||
isLt = function(value, other) { | ||
if (isActualNaN(value) || isActualNaN(other)) { | ||
throw new TypeError('NaN is not a valid value'); | ||
} | ||
return !isInfinite$1(value) && !isInfinite$1(other) && value < other; | ||
}; | ||
// node_modules/es-is/max.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isMax; | ||
isMax = function(value, others) { | ||
var len; | ||
if (isActualNaN(value)) { | ||
throw new TypeError('NaN is not a valid value'); | ||
} else if (!isArrayLike$1(others)) { | ||
throw new TypeError('second argument must be array-like'); | ||
} | ||
len = others.length; | ||
while (--len >= 0) { | ||
if (value < others[len]) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
}; | ||
// node_modules/es-is/min.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isMin; | ||
isMin = function(value, others) { | ||
var len; | ||
if (isActualNaN(value)) { | ||
throw new TypeError('NaN is not a valid value'); | ||
} else if (!isArrayLike$1(others)) { | ||
throw new TypeError('second argument must be array-like'); | ||
} | ||
len = others.length; | ||
while (--len >= 0) { | ||
if (value > others[len]) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
}; | ||
// node_modules/es-is/nan.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isNaN$1; | ||
isNaN$1 = function(value) { | ||
return !isNumber$1(value) || value !== value; | ||
}; | ||
// node_modules/es-is/null.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isNull; | ||
isNull = function(value) { | ||
return value === null; | ||
}; | ||
// node_modules/es-is/odd.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isOdd; | ||
isOdd = function(value) { | ||
return isInfinite$1(value) || isNumber$1(value) && value === value && value % 2 !== 0; | ||
}; | ||
// node_modules/es-is/primitive.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isPrimitive; | ||
isPrimitive = function(value) { | ||
if (!value) { | ||
return true; | ||
} | ||
if (typeof value === 'object' || isObject$1(value) || isFunction$1(value) || isArray$1(value)) { | ||
return false; | ||
} | ||
return true; | ||
}; | ||
// node_modules/es-is/promise.js | ||
@@ -484,80 +140,23 @@ // Generated by CoffeeScript 1.12.5 | ||
// node_modules/es-is/regexp.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isRegExp; | ||
isRegExp = function(value) { | ||
return toString(value) === '[object RegExp]'; | ||
}; | ||
// node_modules/es-is/symbol.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isSymbol; | ||
var symbolValueOf; | ||
symbolValueOf = typeof Symbol === 'function' ? Symbol.prototype.valueOf : void 0; | ||
isSymbol = function(value) { | ||
return typeof Symbol === 'function' && toString(value) === '[object Symbol]' && typeof symbolValueOf.call(value) === 'symbol'; | ||
}; | ||
// node_modules/es-is/true.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isTrue; | ||
isTrue = function(value) { | ||
return isBool$1(value) && Boolean(Number(value)) === true; | ||
}; | ||
// node_modules/es-is/type.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isType; | ||
isType = function(value, type) { | ||
return typeof value === type; | ||
}; | ||
// node_modules/es-is/undefined.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isUndefined; | ||
isUndefined = function(value) { | ||
return typeof value === 'undefined'; | ||
}; | ||
// node_modules/es-is/valid-date.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isValidDate; | ||
isValidDate = function(value) { | ||
return isDate$1(value) && !isNaN(Number(value)); | ||
}; | ||
// node_modules/es-is/within.js | ||
// Generated by CoffeeScript 1.12.5 | ||
var isWithin; | ||
isWithin = function(value, start, finish) { | ||
var isAnyInfinite; | ||
if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) { | ||
throw new TypeError('NaN is not a valid value'); | ||
} else if (!isNumber$1(value) || !isNumber$1(start) || !isNumber$1(finish)) { | ||
throw new TypeError('all arguments must be numbers'); | ||
} | ||
isAnyInfinite = isInfinite$1(value) || isInfinite$1(start) || isInfinite$1(finish); | ||
return isAnyInfinite || value >= start && value <= finish; | ||
}; | ||
// node_modules/es-is/index.mjs | ||
// Generated by CoffeeScript 1.12.5 | ||
// src/spawn/buffer-stream.coffee | ||
var BufferStream; | ||
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | ||
var hasProp = {}.hasOwnProperty; | ||
BufferStream = (function(superClass) { | ||
extend(BufferStream, superClass); | ||
function BufferStream() { | ||
BufferStream.__super__.constructor.call(this); | ||
BufferStream = class BufferStream extends Stream { | ||
constructor() { | ||
super(); | ||
this.buffer = ''; | ||
@@ -567,7 +166,7 @@ this.writable = true; | ||
BufferStream.prototype.write = function(data) { | ||
write(data) { | ||
return this.buffer += data; | ||
}; | ||
} | ||
BufferStream.prototype.end = function(data) { | ||
end(data) { | ||
if (arguments.length) { | ||
@@ -577,22 +176,20 @@ this.write(data); | ||
return this.writable = false; | ||
}; | ||
} | ||
BufferStream.prototype.destroy = function() { | ||
destroy() { | ||
return this.writable = false; | ||
}; | ||
} | ||
BufferStream.prototype.toString = function() { | ||
toString() { | ||
return this.buffer; | ||
}; | ||
} | ||
return BufferStream; | ||
}; | ||
})(Stream); | ||
var BufferStream$1 = BufferStream; | ||
// node_modules/jsonify/lib/parse.js | ||
var at; | ||
var ch; | ||
var escapee = { | ||
var at, // The index of the current character | ||
ch, // The current character | ||
escapee = { | ||
'"': '"', | ||
@@ -606,5 +203,6 @@ '\\': '\\', | ||
t: '\t' | ||
}; | ||
var text; | ||
var error$1 = function (m) { | ||
}, | ||
text, | ||
error$1 = function (m) { | ||
// Call error when something is wrong. | ||
@@ -617,4 +215,5 @@ throw { | ||
}; | ||
}; | ||
var next = function (c) { | ||
}, | ||
next = function (c) { | ||
// If a c parameter is provided, verify that it matches the current character. | ||
@@ -631,4 +230,5 @@ if (c && c !== ch) { | ||
return ch; | ||
}; | ||
var number = function () { | ||
}, | ||
number = function () { | ||
// Parse a number value. | ||
@@ -670,4 +270,5 @@ var number, | ||
} | ||
}; | ||
var string$1 = function () { | ||
}, | ||
string = function () { | ||
// Parse a string value. | ||
@@ -708,5 +309,6 @@ var hex, | ||
error$1("Bad string"); | ||
}; | ||
var white = function () { | ||
}, | ||
white = function () { | ||
// Skip whitespace. | ||
@@ -717,5 +319,6 @@ | ||
} | ||
}; | ||
var word = function () { | ||
}, | ||
word = function () { | ||
// true, false, or null. | ||
@@ -745,6 +348,8 @@ | ||
error$1("Unexpected '" + ch + "'"); | ||
}; | ||
var value; | ||
var array$1 = function () { | ||
}, | ||
value, // Place holder for the value function. | ||
array = function () { | ||
// Parse an array value. | ||
@@ -773,5 +378,6 @@ | ||
error$1("Bad array"); | ||
}; | ||
var object$1 = function () { | ||
}, | ||
object = function () { | ||
// Parse an object value. | ||
@@ -790,3 +396,3 @@ | ||
while (ch) { | ||
key = string$1(); | ||
key = string(); | ||
white(); | ||
@@ -818,7 +424,7 @@ next(':'); | ||
case '{': | ||
return object$1(); | ||
return object(); | ||
case '[': | ||
return array$1(); | ||
return array(); | ||
case '"': | ||
return string$1(); | ||
return string(); | ||
case '-': | ||
@@ -834,3 +440,3 @@ return number(); | ||
var parse$4 = function (source, reviver) { | ||
var parse = function (source, reviver) { | ||
var result; | ||
@@ -872,6 +478,6 @@ | ||
// node_modules/jsonify/lib/stringify.js | ||
var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; | ||
var gap; | ||
var indent; | ||
var meta = { // table of character substitutions | ||
var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, | ||
gap, | ||
indent, | ||
meta = { // table of character substitutions | ||
'\b': '\\b', | ||
@@ -884,6 +490,6 @@ '\t': '\\t', | ||
'\\': '\\\\' | ||
}; | ||
var rep; | ||
}, | ||
rep; | ||
function quote$1(string) { | ||
function quote(string) { | ||
// If the string contains no control characters, no quote characters, and no | ||
@@ -927,3 +533,3 @@ // backslash characters, then we can safely slap some quotes around it. | ||
case 'string': | ||
return quote$1(value); | ||
return quote(value); | ||
@@ -971,3 +577,3 @@ case 'number': | ||
if (v) { | ||
partial.push(quote$1(k) + (gap ? ': ' : ':') + v); | ||
partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
} | ||
@@ -983,3 +589,3 @@ } | ||
if (v) { | ||
partial.push(quote$1(k) + (gap ? ': ' : ':') + v); | ||
partial.push(quote(k) + (gap ? ': ' : ':') + v); | ||
} | ||
@@ -1001,3 +607,3 @@ } | ||
var stringify$1 = function (value, replacer, space) { | ||
var stringify = function (value, replacer, space) { | ||
var i; | ||
@@ -1037,12 +643,12 @@ gap = ''; | ||
// node_modules/jsonify/index.js | ||
var parse$3 = parse$4; | ||
var stringify = stringify$1; | ||
var parse$1 = parse; | ||
var stringify$1 = stringify; | ||
var index$1 = { | ||
parse: parse$3, | ||
stringify: stringify | ||
var jsonify = { | ||
parse: parse$1, | ||
stringify: stringify$1 | ||
}; | ||
// node_modules/array-map/index.js | ||
var index$3 = function (xs, f) { | ||
var arrayMap = function (xs, f) { | ||
if (xs.map) return xs.map(f); | ||
@@ -1068,3 +674,3 @@ var res = []; | ||
var index$5 = function (arr, fn) { | ||
var arrayFilter = function (arr, fn) { | ||
if (arr.filter) return arr.filter(fn); | ||
@@ -1084,3 +690,3 @@ var ret = []; | ||
var index$7 = function (xs, f, acc) { | ||
var arrayReduce = function (xs, f, acc) { | ||
var hasAcc = arguments.length >= 3; | ||
@@ -1111,3 +717,3 @@ if (hasAcc && xs.reduce) return xs.reduce(f, acc); | ||
// node_modules/shell-quote/index.js | ||
var json = typeof JSON !== undefined ? JSON : index$1; | ||
var json = typeof JSON !== undefined ? JSON : jsonify; | ||
@@ -1117,4 +723,4 @@ | ||
var quote = function (xs) { | ||
return index$3(xs, function (s) { | ||
var quote$1 = function (xs) { | ||
return arrayMap(xs, function (s) { | ||
if (s && typeof s === 'object') { | ||
@@ -1151,7 +757,7 @@ return s.op.replace(/(.)/g, '\\$1'); | ||
if (typeof env !== 'function') return mapped; | ||
return index$7(mapped, function (acc, s) { | ||
return arrayReduce(mapped, function (acc, s) { | ||
if (typeof s === 'object') return acc.concat(s); | ||
var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g')); | ||
if (xs.length === 1) return acc.concat(xs[0]); | ||
return acc.concat(index$3(index$5(xs, Boolean), function (x) { | ||
return acc.concat(arrayMap(arrayFilter(xs, Boolean), function (x) { | ||
if (RegExp('^' + TOKEN).test(x)) { | ||
@@ -1170,3 +776,3 @@ return json.parse(x.split(TOKEN)[1]); | ||
].join('|'), 'g'); | ||
var match = index$5(s.match(chunker), Boolean); | ||
var match = arrayFilter(s.match(chunker), Boolean); | ||
var commented = false; | ||
@@ -1177,3 +783,3 @@ | ||
if (!opts) opts = {}; | ||
return index$3(match, function (s, j) { | ||
return arrayMap(match, function (s, j) { | ||
if (commented) { | ||
@@ -1316,4 +922,4 @@ return; | ||
var index = { | ||
quote: quote, | ||
var shellQuote = { | ||
quote: quote$1, | ||
parse: parse_1 | ||
@@ -1326,11 +932,12 @@ }; | ||
var builtins = shellBuiltins = { | ||
// Bourne Shell builtins | ||
':': true, | ||
'.': true, | ||
"break": true, | ||
break: true, | ||
cd: true, | ||
"continue": true, | ||
"eval": true, | ||
continue: true, | ||
eval: true, | ||
exec: true, | ||
exit: true, | ||
"export": true, | ||
export: true, | ||
getopts: true, | ||
@@ -1340,3 +947,3 @@ hash: true, | ||
readonly: true, | ||
"return": true, | ||
return: true, | ||
shift: true, | ||
@@ -1348,2 +955,3 @@ test: true, | ||
unset: true, | ||
// Bash shell builtins | ||
alias: true, | ||
@@ -1358,3 +966,3 @@ bind: true, | ||
help: true, | ||
"let": true, | ||
let: true, | ||
local: true, | ||
@@ -1374,13 +982,7 @@ logout: true, | ||
// src/spawn/parse.coffee | ||
var isWin; | ||
var parse$$1; | ||
var parseObject; | ||
var parseShell; | ||
var parseString; | ||
var shellRequired; | ||
var unShellQuote; | ||
var winHacks; | ||
var isWin, parse$3, parseObject, parseShell, parseString, shellRequired, unShellQuote, winHacks; | ||
isWin = /^win/.test(process.platform); | ||
// Convert objects in shell-quote results back into string arguments | ||
unShellQuote = function(args) { | ||
@@ -1404,15 +1006,18 @@ var a, args_, i, len; | ||
parseShell = function(s, env, first) { | ||
var args, cmd, foundEnv, k, ref, v; | ||
if (first == null) { | ||
first = true; | ||
} | ||
args = index.parse(s, env); | ||
// Parse string containing shell command | ||
parseShell = function(s, env, first = true) { | ||
var args, cmd, foundEnv, k, v; | ||
args = shellQuote.parse(s, env); | ||
// Grab command (usually first argument) | ||
cmd = args.shift(); | ||
while (~cmd.indexOf('=')) { | ||
// Found env var i.e., FOO=1 echo $FOO | ||
foundEnv = true; | ||
ref = cmd.split('=', 2), k = ref[0], v = ref[1]; | ||
// Update env object | ||
[k, v] = cmd.split('=', 2); | ||
env[k] = v; | ||
// Grab next arg, see if it's a command | ||
cmd = args.shift(); | ||
} | ||
// Re-parse w/o inline env variables if any discovered | ||
if (first && foundEnv) { | ||
@@ -1424,8 +1029,10 @@ return parseShell(s, env, false); | ||
// Parse cmd, args, env from string | ||
parseString = function(s, opts) { | ||
var args, cmd, env, ref; | ||
var args, cmd, env; | ||
env = Object.assign({}, process.env, opts.env); | ||
return ref = parseShell(s, env), cmd = ref[0], args = ref[1], env = ref[2], ref; | ||
return [cmd, args, env] = parseShell(s, env); | ||
}; | ||
// Parse cmd, args, env from object | ||
parseObject = function(obj, opts) { | ||
@@ -1439,2 +1046,3 @@ var args, cmd, env, ref; | ||
// Check for any operators or glob patterns | ||
shellRequired = function(cmd, args) { | ||
@@ -1454,2 +1062,3 @@ var arg, i, len; | ||
// Couple of hacks to ensure commands run smoothly on Windows | ||
winHacks = function(cmd, args) { | ||
@@ -1460,4 +1069,6 @@ var cmdfile; | ||
if (fs.existsSync(cmdfile)) { | ||
// Use .cmd version of command if it exists | ||
cmd = cmdfile; | ||
} | ||
// Setup arguments for cmd.exe and use that as executable | ||
args = ['/c', cmd].concat(args); | ||
@@ -1468,14 +1079,14 @@ cmd = 'cmd.exe'; | ||
var parse$1 = parse$$1 = function(cmdArgs, opts) { | ||
var args, cmd, env, ref, ref1, ref2; | ||
if (opts == null) { | ||
opts = {}; | ||
} | ||
// Parse cmd, args, env from string or object | ||
var parse$4 = parse$3 = function(cmdArgs, opts = {}) { | ||
var args, cmd, env; | ||
// Handle string, object style cmd+args | ||
if (isString$1(cmdArgs)) { | ||
ref = parseString(cmdArgs, opts), cmd = ref[0], args = ref[1], env = ref[2]; | ||
[cmd, args, env] = parseString(cmdArgs, opts); | ||
} else if (isObject$1(cmdArgs)) { | ||
ref1 = parseObject(cmdArgs, opts), cmd = ref1[0], args = ref1[1], env = ref1[2]; | ||
[cmd, args, env] = parseObject(cmdArgs, opts); | ||
} else { | ||
throw new Error("Unable to parse command '" + cmdArgs + "'"); | ||
throw new Error(`Unable to parse command '${cmdArgs}'`); | ||
} | ||
// Detect if shell is required and stringify args correctly | ||
if (shellRequired(cmd, args)) { | ||
@@ -1488,4 +1099,6 @@ if (opts.shell == null) { | ||
if (isWin) { | ||
ref2 = winHacks(cmd, args), cmd = ref2[0], args = ref2[1]; | ||
// Apply hacks to work around Windows oddities if necessary | ||
[cmd, args] = winHacks(cmd, args); | ||
} | ||
// Our normalized cmd, args and opts | ||
return [cmd, args, opts]; | ||
@@ -1495,9 +1108,11 @@ }; | ||
// src/utils.coffee | ||
// Log error | ||
var logError = function(err) { | ||
if ((err.code === 'ENOENT') && /^spawn/.test(err.syscall)) { | ||
console.error("Error: " + err.code + ", " + err.syscall); | ||
return console.error("Make sure '" + err.cmd + "' exists and is executable."); | ||
console.error(`Error: ${err.code}, ${err.syscall}`); | ||
return console.error(`Make sure '${err.cmd}' exists and is executable.`); | ||
} | ||
}; | ||
// Run command exactly once | ||
var once = function(fn) { | ||
@@ -1518,2 +1133,3 @@ var ran, result; | ||
// Merge stdout, stderr, status into results object | ||
var mergeResult = function(stdout, stderr, status, object) { | ||
@@ -1535,7 +1151,7 @@ var ret; | ||
// src/spawn/async.coffee | ||
var async$1; | ||
var async; | ||
var async$2 = async$1 = function(cmd, opts, cb) { | ||
var args, child, done, exit, ref, ref1, ref2, ref3, stderr, stdout; | ||
ref = parse$1(cmd, opts), cmd = ref[0], args = ref[1], opts = ref[2]; | ||
var async$1 = async = function(cmd, opts, cb) { | ||
var args, child, done, exit, ref, ref1, ref2, stderr, stdout; | ||
[cmd, args, opts] = parse$4(cmd, opts); | ||
stderr = new BufferStream$1(); | ||
@@ -1547,3 +1163,3 @@ stdout = new BufferStream$1(); | ||
argv0: opts.argv0, | ||
stdio: (ref1 = opts.stdio) != null ? ref1 : [0, 'pipe', 'pipe'], | ||
stdio: (ref = opts.stdio) != null ? ref : [0, 'pipe', 'pipe'], | ||
detached: opts.detached, | ||
@@ -1555,4 +1171,5 @@ uid: opts.uid, | ||
child.setMaxListeners(0); | ||
child.stdout.setEncoding((ref2 = opts.encoding) != null ? ref2 : 'utf8'); | ||
child.stderr.setEncoding((ref3 = opts.encoding) != null ? ref3 : 'utf8'); | ||
child.stdout.setEncoding((ref1 = opts.encoding) != null ? ref1 : 'utf8'); | ||
child.stderr.setEncoding((ref2 = opts.encoding) != null ? ref2 : 'utf8'); | ||
// Buffer stderr, stdout | ||
if (!opts.interactive) { | ||
@@ -1562,2 +1179,3 @@ child.stdout.pipe(stdout); | ||
} | ||
// Echo out as well | ||
if (!opts.quiet) { | ||
@@ -1589,3 +1207,3 @@ child.stdout.pipe(process.stdout); | ||
if (status !== 0) { | ||
err = new Error("Command failed, '" + cmd + "' exited with status " + status); | ||
err = new Error(`Command failed, '${cmd}' exited with status ${status}`); | ||
err.signal = signal; | ||
@@ -1595,3 +1213,5 @@ } | ||
}); | ||
// Close fires after exit so we are relying on it for now. | ||
child.on('close', exit); | ||
// child.on 'exit', exit | ||
child.on('error', done); | ||
@@ -1602,11 +1222,11 @@ return child; | ||
// src/spawn/sync.coffee | ||
var sync$1; | ||
var sync; | ||
var sync$2 = sync$1 = function(cmd, opts, cb) { | ||
var args, error, output, pid, ref, ref1, ref2, ref3, signal, status, stderr, stdout; | ||
ref = parse$1(cmd, opts), cmd = ref[0], args = ref[1], opts = ref[2]; | ||
ref3 = child_process.spawnSync(cmd, args, { | ||
var sync$1 = sync = function(cmd, opts, cb) { | ||
var args, error, output, pid, ref, ref1, signal, status, stderr, stdout; | ||
[cmd, args, opts] = parse$4(cmd, opts); | ||
({pid, output, stdout, stderr, status, signal, error} = child_process.spawnSync(cmd, args, { | ||
cwd: opts.cwd, | ||
input: opts.input, | ||
stdio: (ref1 = opts.stdio) != null ? ref1 : [0, 'pipe', 'pipe'], | ||
stdio: (ref = opts.stdio) != null ? ref : [0, 'pipe', 'pipe'], | ||
env: opts.env, | ||
@@ -1618,5 +1238,4 @@ uid: opts.uid, | ||
maxBuffer: opts.maxBuffer, | ||
encoding: (ref2 = opts.encoding) != null ? ref2 : 'utf8' | ||
}), pid = ref3.pid, output = ref3.output, stdout = ref3.stdout, stderr = ref3.stderr, status = ref3.status, signal = ref3.signal, error = ref3.error; | ||
opts; | ||
encoding: (ref1 = opts.encoding) != null ? ref1 : 'utf8' | ||
})); | ||
if (!opts.quiet) { | ||
@@ -1627,3 +1246,3 @@ process.stdout.write(stdout); | ||
if ((error == null) && status !== 0) { | ||
error = new Error("Command failed, '" + cmd + "' exited with status " + status); | ||
error = new Error(`Command failed, '${cmd}' exited with status ${status}`); | ||
} | ||
@@ -1652,2 +1271,3 @@ if (error != null) { | ||
// Execute commands in parallel | ||
var parallel$1 = parallel = function(fn, cmds, opts, cb) { | ||
@@ -1664,8 +1284,5 @@ var append, cmd, done, errAll, errors, object, outAll, todo; | ||
} | ||
append = function(key, res) { | ||
var error, status, stderr, stdout; | ||
if (res == null) { | ||
res = {}; | ||
} | ||
error = res.error, stdout = res.stdout, stderr = res.stderr, status = res.status; | ||
append = function(key, res = {}) { | ||
var error$$1, status, stderr, stdout; | ||
({error: error$$1, stdout, stderr, status} = res); | ||
if (stdout != null) { | ||
@@ -1677,10 +1294,5 @@ outAll += stdout; | ||
} | ||
if (status != null) { | ||
status; | ||
} else { | ||
0; | ||
} | ||
if (key != null) { | ||
return object[key] = { | ||
error: error, | ||
error: error$$1, | ||
stdout: stdout, | ||
@@ -1692,6 +1304,3 @@ stderr: stderr, | ||
}; | ||
done = function(err, status) { | ||
if (status == null) { | ||
status = 0; | ||
} | ||
done = function(err, status = 0) { | ||
if (err != null) { | ||
@@ -1716,5 +1325,5 @@ if (!opts.quiet) { | ||
(function(cmd) { | ||
var err, key, ref, val; | ||
var err, key, val; | ||
if (isArray$1(cmd)) { | ||
ref = cmd, key = ref[0], cmd = ref[1]; | ||
[key, cmd] = cmd; | ||
} | ||
@@ -1751,3 +1360,3 @@ if (isString$1(cmd)) { | ||
return done(null, 0); | ||
})["catch"](function(err) { | ||
}).catch(function(err) { | ||
return done(err); | ||
@@ -1763,2 +1372,3 @@ }); | ||
// Execute commands in serial | ||
var serial$1 = serial = function(fn, cmds, opts, cb) { | ||
@@ -1774,8 +1384,5 @@ var append, errAll, lastStatus, next, object, outAll; | ||
} | ||
append = function(key, res) { | ||
var error, status, stderr, stdout; | ||
if (res == null) { | ||
res = {}; | ||
} | ||
error = res.error, stdout = res.stdout, stderr = res.stderr, status = res.status; | ||
append = function(key, res = {}) { | ||
var error$$1, status, stderr, stdout; | ||
({error: error$$1, stdout, stderr, status} = res); | ||
if (stdout != null) { | ||
@@ -1794,3 +1401,3 @@ outAll += stdout; | ||
return object[key] = { | ||
error: error, | ||
error: error$$1, | ||
stdout: stdout, | ||
@@ -1803,3 +1410,3 @@ stderr: stderr, | ||
return (next = function() { | ||
var cmd, err, key, ref, val; | ||
var cmd, err, key, val; | ||
if (!cmds.length) { | ||
@@ -1810,3 +1417,3 @@ return cb(null, outAll, errAll, lastStatus, object); | ||
if (isArray$1(cmd)) { | ||
ref = cmd, key = ref[0], cmd = ref[1]; | ||
[key, cmd] = cmd; | ||
} | ||
@@ -1832,3 +1439,3 @@ if (isString$1(cmd)) { | ||
return next(); | ||
})["catch"](function(err) { | ||
}).catch(function(err) { | ||
return cb(err, outAll, errAll, 1, object); | ||
@@ -1850,3 +1457,3 @@ }); | ||
} else { | ||
return cb(new Error("Not a valid command: " + (cmd.toString()))); | ||
return cb(new Error(`Not a valid command: ${cmd.toString()}`)); | ||
} | ||
@@ -1857,7 +1464,6 @@ })(); | ||
// src/flow/index.coffee | ||
var array; | ||
var object; | ||
var string; | ||
var array$1, object$1, string$1; | ||
array = function(exec, cmds, opts, cb) { | ||
// Execute array of commands, with serial exution by default | ||
array$1 = function(exec, cmds, opts, cb) { | ||
if (opts.parallel) { | ||
@@ -1870,3 +1476,4 @@ return parallel$1(exec, cmds, opts, cb); | ||
string = function(exec, str, opts, cb) { | ||
// Execute string representing commands | ||
string$1 = function(exec, str, opts, cb) { | ||
var cmds, s; | ||
@@ -1885,6 +1492,7 @@ cmds = (function() { | ||
})(); | ||
return array(exec, cmds, opts, cb); | ||
return array$1(exec, cmds, opts, cb); | ||
}; | ||
object = function(exec, obj, opts, cb) { | ||
// Execute object of commands | ||
object$1 = function(exec, obj, opts, cb) { | ||
var cmd, cmds, k; | ||
@@ -1900,26 +1508,28 @@ cmds = (function() { | ||
})(); | ||
return array(exec, cmds, opts, cb); | ||
return array$1(exec, cmds, opts, cb); | ||
}; | ||
var flow = function(cmds, opts, cb) { | ||
// Execute commands using either serial or parallel control flow and return | ||
// result to cb | ||
function flow(cmds, opts, cb) { | ||
var exec; | ||
exec = opts.sync ? sync$2 : async$2; | ||
// Use sync exec if necessary | ||
exec = opts.sync ? sync$1 : async$1; | ||
if (isString$1(cmds)) { | ||
return string(exec, cmds, opts, cb); | ||
return string$1(exec, cmds, opts, cb); | ||
} | ||
if (isObject$1(cmds)) { | ||
return object(exec, cmds, opts, cb); | ||
return object$1(exec, cmds, opts, cb); | ||
} | ||
if (isArray$1(cmds)) { | ||
return array(exec, cmds, opts, cb); | ||
return array$1(exec, cmds, opts, cb); | ||
} | ||
throw new Error("Unable to return results for cmds = " + (JSON.stringify(cmds))); | ||
}; | ||
throw new Error(`Unable to return results for cmds = ${JSON.stringify(cmds)}`); | ||
} | ||
// src/executive.coffee | ||
var async; | ||
var promise; | ||
var sync; | ||
var async$2, promise, sync$2; | ||
async = function(cmds, opts, cb) { | ||
// Return executive results asynchronously | ||
async$2 = function(cmds, opts, cb) { | ||
return flow(cmds, opts, function(err, stdout, stderr, status, object) { | ||
@@ -1936,5 +1546,7 @@ var obj; | ||
sync = function(cmds, opts) { | ||
// Return executive results synchronously | ||
sync$2 = function(cmds, opts) { | ||
var ret; | ||
ret = null; | ||
// This happens synchronously | ||
flow(cmds, opts, function(err, stdout, stderr, status, object) { | ||
@@ -1953,2 +1565,3 @@ if (opts.syncThrows) { | ||
// Return executive results as promise | ||
promise = function(cmds, opts) { | ||
@@ -1967,7 +1580,9 @@ return new Promise(function(resolve, reject) { | ||
var exec$1 = function(cmds, opts, cb) { | ||
var ref; | ||
// Run string, array or object commands and return results | ||
function exec(cmds, opts, cb) { | ||
// Passed only callback | ||
if (isFunction$1(opts)) { | ||
ref = [opts, {}], cb = ref[0], opts = ref[1]; | ||
[cb, opts] = [opts, {}]; | ||
} | ||
// Ensure opts exists | ||
if (opts == null) { | ||
@@ -1977,9 +1592,12 @@ opts = {}; | ||
if (isFunction$1(cb)) { | ||
return async(cmds, opts, cb); | ||
// Async exec with errback-style callback | ||
return async$2(cmds, opts, cb); | ||
} | ||
if (opts.sync) { | ||
return sync(cmds, opts); | ||
// Blocking exec | ||
return sync$2(cmds, opts); | ||
} | ||
// Async exec with Promise API expected | ||
return promise(cmds, opts); | ||
}; | ||
} | ||
@@ -1989,37 +1607,38 @@ // src/index.coffee | ||
// Set defaults for various helpers | ||
partial = function(defaults) { | ||
return function(cmds, opts, cb) { | ||
var ref; | ||
if (isFunction$1(opts)) { | ||
ref = [opts, {}], cb = ref[0], opts = ref[1]; | ||
[cb, opts] = [opts, {}]; | ||
} | ||
return exec$1(cmds, Object.assign({}, defaults, opts), cb); | ||
return exec(cmds, Object.assign({}, defaults, opts), cb); | ||
}; | ||
}; | ||
exec$1.interactive = partial({ | ||
// Defaults | ||
exec.interactive = partial({ | ||
interactive: true | ||
}); | ||
exec$1.parallel = partial({ | ||
exec.parallel = partial({ | ||
parallel: true | ||
}); | ||
exec$1.quiet = partial({ | ||
exec.quiet = partial({ | ||
quiet: true | ||
}); | ||
exec$1.serial = partial({ | ||
exec.serial = partial({ | ||
parallel: false | ||
}); | ||
exec$1.strict = partial({ | ||
exec.strict = partial({ | ||
strict: true | ||
}); | ||
exec$1.sync = partial({ | ||
exec.sync = partial({ | ||
sync: true | ||
}); | ||
module.exports = exec$1; | ||
module.exports = exec; | ||
//# sourceMappingURL=executive.js.map |
{ | ||
"name": "executive", | ||
"version": "1.5.12", | ||
"version": "1.5.13", | ||
"description": "Elegant command execution with built-in control flow", | ||
@@ -44,7 +44,7 @@ "main": "lib/executive.js", | ||
"devDependencies": { | ||
"coffee-script": "1.12.6", | ||
"coffeescript": "^2.2.3", | ||
"es-is": "^3.3.10", | ||
"sake-bundle": "^0.5.3", | ||
"sake-cli": "^0.5.14", | ||
"sake-outdated": "^0.1.27", | ||
"sake-bundle": "^0.6.4", | ||
"sake-cli": "^0.5.24", | ||
"sake-outdated": "^0.2.1", | ||
"sake-publish": "^0.1.16", | ||
@@ -56,2 +56,2 @@ "sake-test": "^0.1.5", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
Found 1 instance in 1 package
2
245545
2756