cross-spawn-cb 0.6.13 → 0.6.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["cross-spawn-6.0.5.js"],"sourcesContent":["'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nvar require$$0$2 = require('child_process');\n\nvar require$$0$1 = require('path');\n\nvar require$$0 = require('fs');\n\nvar require$$5 = require('semver');\n\nfunction _interopDefaultLegacy(e) {\n return e && _typeof(e) === 'object' && 'default' in e ? e : {\n 'default': e\n };\n}\n\nvar require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);\n\nvar require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);\n\nvar require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);\n\nvar require$$5__default = /*#__PURE__*/_interopDefaultLegacy(require$$5);\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\nvar crossSpawn = {\n exports: {}\n};\n/**\n * Tries to execute a function and discards any error that occurs.\n * @param {Function} fn - Function that might or might not throw an error.\n * @returns {?*} Return-value of the function when no error occurred.\n */\n\nvar src = function src(fn) {\n try {\n return fn();\n } catch (e) {}\n};\n\nvar windows;\nvar hasRequiredWindows;\n\nfunction requireWindows() {\n if (hasRequiredWindows) return windows;\n hasRequiredWindows = 1;\n windows = isexe;\n isexe.sync = sync;\n var fs = require$$0__default[\"default\"];\n\n function checkPathExt(path, options) {\n var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;\n\n if (!pathext) {\n return true;\n }\n\n pathext = pathext.split(';');\n\n if (pathext.indexOf('') !== -1) {\n return true;\n }\n\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase();\n\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true;\n }\n }\n\n return false;\n }\n\n function checkStat(stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false;\n }\n\n return checkPathExt(path, options);\n }\n\n function isexe(path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options));\n });\n }\n\n function sync(path, options) {\n return checkStat(fs.statSync(path), path, options);\n }\n\n return windows;\n}\n\nvar mode;\nvar hasRequiredMode;\n\nfunction requireMode() {\n if (hasRequiredMode) return mode;\n hasRequiredMode = 1;\n mode = isexe;\n isexe.sync = sync;\n var fs = require$$0__default[\"default\"];\n\n function isexe(path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options));\n });\n }\n\n function sync(path, options) {\n return checkStat(fs.statSync(path), options);\n }\n\n function checkStat(stat, options) {\n return stat.isFile() && checkMode(stat, options);\n }\n\n function checkMode(stat, options) {\n var mod = stat.mode;\n var uid = stat.uid;\n var gid = stat.gid;\n var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();\n var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();\n var u = parseInt('100', 8);\n var g = parseInt('010', 8);\n var o = parseInt('001', 8);\n var ug = u | g;\n var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;\n return ret;\n }\n\n return mode;\n}\n\nvar core;\n\nif (process.platform === 'win32' || commonjsGlobal.TESTING_WINDOWS) {\n core = requireWindows();\n} else {\n core = requireMode();\n}\n\nvar isexe_1 = isexe$1;\nisexe$1.sync = sync$1;\n\nfunction isexe$1(path, options, cb) {\n if (typeof options === 'function') {\n cb = options;\n options = {};\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided');\n }\n\n return new Promise(function (resolve, reject) {\n isexe$1(path, options || {}, function (er, is) {\n if (er) {\n reject(er);\n } else {\n resolve(is);\n }\n });\n });\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null;\n is = false;\n }\n }\n\n cb(er, is);\n });\n}\n\nfunction sync$1(path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {});\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false;\n } else {\n throw er;\n }\n }\n}\n\nvar which_1 = which$1;\nwhich$1.sync = whichSync;\nvar isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys';\nvar path$2 = require$$0__default$1[\"default\"];\nvar COLON = isWindows ? ';' : ':';\nvar isexe = isexe_1;\n\nfunction getNotFoundError(cmd) {\n var er = new Error('not found: ' + cmd);\n er.code = 'ENOENT';\n return er;\n}\n\nfunction getPathInfo(cmd, opt) {\n var colon = opt.colon || COLON;\n var pathEnv = opt.path || process.env.PATH || '';\n var pathExt = [''];\n pathEnv = pathEnv.split(colon);\n var pathExtExe = '';\n\n if (isWindows) {\n pathEnv.unshift(process.cwd());\n pathExtExe = opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM';\n pathExt = pathExtExe.split(colon); // Always test the cmd itself first. isexe will check to make sure\n // it's found in the pathExt set.\n\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') pathExt.unshift('');\n } // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n\n\n if (cmd.match(/\\//) || isWindows && cmd.match(/\\\\/)) pathEnv = [''];\n return {\n env: pathEnv,\n ext: pathExt,\n extExe: pathExtExe\n };\n}\n\nfunction which$1(cmd, opt, cb) {\n if (typeof opt === 'function') {\n cb = opt;\n opt = {};\n }\n\n var info = getPathInfo(cmd, opt);\n var pathEnv = info.env;\n var pathExt = info.ext;\n var pathExtExe = info.extExe;\n var found = [];\n\n (function F(i, l) {\n if (i === l) {\n if (opt.all && found.length) return cb(null, found);else return cb(getNotFoundError(cmd));\n }\n\n var pathPart = pathEnv[i];\n if (pathPart.charAt(0) === '\"' && pathPart.slice(-1) === '\"') pathPart = pathPart.slice(1, -1);\n var p = path$2.join(pathPart, cmd);\n\n if (!pathPart && /^\\.[\\\\\\/]/.test(cmd)) {\n p = cmd.slice(0, 2) + p;\n }\n\n (function E(ii, ll) {\n if (ii === ll) return F(i + 1, l);\n var ext = pathExt[ii];\n isexe(p + ext, {\n pathExt: pathExtExe\n }, function (er, is) {\n if (!er && is) {\n if (opt.all) found.push(p + ext);else return cb(null, p + ext);\n }\n\n return E(ii + 1, ll);\n });\n })(0, pathExt.length);\n })(0, pathEnv.length);\n}\n\nfunction whichSync(cmd, opt) {\n opt = opt || {};\n var info = getPathInfo(cmd, opt);\n var pathEnv = info.env;\n var pathExt = info.ext;\n var pathExtExe = info.extExe;\n var found = [];\n\n for (var i = 0, l = pathEnv.length; i < l; i++) {\n var pathPart = pathEnv[i];\n if (pathPart.charAt(0) === '\"' && pathPart.slice(-1) === '\"') pathPart = pathPart.slice(1, -1);\n var p = path$2.join(pathPart, cmd);\n\n if (!pathPart && /^\\.[\\\\\\/]/.test(cmd)) {\n p = cmd.slice(0, 2) + p;\n }\n\n for (var j = 0, ll = pathExt.length; j < ll; j++) {\n var cur = p + pathExt[j];\n var is;\n\n try {\n is = isexe.sync(cur, {\n pathExt: pathExtExe\n });\n\n if (is) {\n if (opt.all) found.push(cur);else return cur;\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length) return found;\n if (opt.nothrow) return null;\n throw getNotFoundError(cmd);\n}\n\nvar pathKey$1 = function pathKey$1(opts) {\n opts = opts || {};\n var env = opts.env || process.env;\n var platform = opts.platform || process.platform;\n\n if (platform !== 'win32') {\n return 'PATH';\n }\n\n return Object.keys(env).find(function (x) {\n return x.toUpperCase() === 'PATH';\n }) || 'Path';\n};\n\nvar path$1 = require$$0__default$1[\"default\"];\nvar which = which_1;\nvar pathKey = pathKey$1();\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n var cwd = process.cwd();\n var hasCustomCwd = parsed.options.cwd != null; // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n\n if (hasCustomCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n var resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: (parsed.options.env || process.env)[pathKey],\n pathExt: withoutPathExt ? path$1.delimiter : undefined\n });\n } catch (e) {\n /* Empty */\n } finally {\n process.chdir(cwd);\n } // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n\n\n if (resolved) {\n resolved = path$1.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand$1(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nvar resolveCommand_1 = resolveCommand$1;\nvar _escape = {}; // See http://www.robvanderwoude.com/escapechars.php\n\nvar metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\n\nfunction escapeCommand(arg) {\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n return arg;\n}\n\nfunction escapeArgument(arg, doubleEscapeMetaChars) {\n // Convert to string\n arg = \"\".concat(arg); // Algorithm below is based on https://qntm.org/cmd\n // Sequence of backslashes followed by a double quote:\n // double up all the backslashes and escape the double quote\n\n arg = arg.replace(/(\\\\*)\"/g, '$1$1\\\\\"'); // Sequence of backslashes followed by the end of the string\n // (which will become a double quote later):\n // double up all the backslashes\n\n arg = arg.replace(/(\\\\*)$/, '$1$1'); // All other backslashes occur literally\n // Quote the whole thing:\n\n arg = \"\\\"\".concat(arg, \"\\\"\"); // Escape meta chars\n\n arg = arg.replace(metaCharsRegExp, '^$1'); // Double escape meta chars if necessary\n\n if (doubleEscapeMetaChars) {\n arg = arg.replace(metaCharsRegExp, '^$1');\n }\n\n return arg;\n}\n\n_escape.command = escapeCommand;\n_escape.argument = escapeArgument;\nvar shebangRegex$1 = /^#!.*/;\nvar shebangRegex = shebangRegex$1;\n\nvar shebangCommand$1 = function shebangCommand$1(str) {\n var match = str.match(shebangRegex);\n\n if (!match) {\n return null;\n }\n\n var arr = match[0].replace(/#! ?/, '').split(' ');\n var bin = arr[0].split('/').pop();\n var arg = arr[1];\n return bin === 'env' ? arg : bin + (arg ? ' ' + arg : '');\n};\n\nvar fs = require$$0__default[\"default\"];\nvar shebangCommand = shebangCommand$1;\n\nfunction readShebang$1(command) {\n // Read the first 150 bytes from the file\n var size = 150;\n var buffer;\n\n if (Buffer.alloc) {\n // Node.js v4.5+ / v5.10+\n buffer = Buffer.alloc(size);\n } else {\n // Old Node.js API\n buffer = new Buffer(size);\n buffer.fill(0); // zero-fill\n }\n\n var fd;\n\n try {\n fd = fs.openSync(command, 'r');\n fs.readSync(fd, buffer, 0, size, 0);\n fs.closeSync(fd);\n } catch (e) {\n /* Empty */\n } // Attempt to extract shebang (null is returned if not a shebang)\n\n\n return shebangCommand(buffer.toString());\n}\n\nvar readShebang_1 = readShebang$1;\nvar path = require$$0__default$1[\"default\"];\nvar niceTry = src;\nvar resolveCommand = resolveCommand_1;\nvar escape = _escape;\nvar readShebang = readShebang_1;\nvar semver = require$$5__default[\"default\"];\nvar isWin$1 = process.platform === 'win32';\nvar isExecutableRegExp = /\\.(?:com|exe)$/i;\nvar isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i; // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0\n\nvar supportsShellOption = niceTry(function () {\n return semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true);\n}) || false;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n var shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nvar NODES = ['node', 'node.exe', 'node.cmd'];\n\nfunction parseNonShell(parsed) {\n if (!isWin$1) {\n return parsed;\n } // Detect & add support for shebangs\n\n var commandFile = detectShebang(parsed); // We don't need a shell if the command filename is an executable\n\n var needsShell = !isExecutableRegExp.test(commandFile); // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n\n // KM: force node to use the shell\n if (!needsShell && NODES.indexOf(path.basename(commandFile).toLowerCase()) >=0) needsShell = true;\n\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n var needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n\n parsed.command = path.normalize(parsed.command); // Escape command & arguments\n\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map(function (arg) {\n return escape.argument(arg, needsDoubleEscapeMetaChars);\n });\n var shellCommand = [parsed.command].concat(parsed.args).join(' ');\n parsed.args = ['/d', '/s', '/c', \"\\\"\".concat(shellCommand, \"\\\"\")];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parseShell(parsed) {\n // If node supports the shell option, there's no need to mimic its behavior\n if (supportsShellOption) {\n return parsed;\n } // Mimic node shell option\n // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335\n\n\n var shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n if (isWin$1) {\n parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';\n parsed.args = ['/d', '/s', '/c', \"\\\"\".concat(shellCommand, \"\\\"\")];\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n } else {\n if (typeof parsed.options.shell === 'string') {\n parsed.command = parsed.options.shell;\n } else if (process.platform === 'android') {\n parsed.command = '/system/bin/sh';\n } else {\n parsed.command = '/bin/sh';\n }\n\n parsed.args = ['-c', shellCommand];\n }\n\n return parsed;\n}\n\nfunction parse$1(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n\n options = Object.assign({}, options); // Clone object to avoid changing the original\n // Build our parsed object\n\n var parsed = {\n command: command,\n args: args,\n options: options,\n file: undefined,\n original: {\n command: command,\n args: args\n }\n }; // Delegate further parsing to shell or non-shell\n\n return options.shell ? parseShell(parsed) : parseNonShell(parsed);\n}\n\nvar parse_1 = parse$1;\nvar isWin = process.platform === 'win32';\n\nfunction notFoundError(original, syscall) {\n return Object.assign(new Error(\"\".concat(syscall, \" \").concat(original.command, \" ENOENT\")), {\n code: 'ENOENT',\n errno: 'ENOENT',\n syscall: \"\".concat(syscall, \" \").concat(original.command),\n path: original.command,\n spawnargs: original.args\n });\n}\n\nfunction hookChildProcess(cp, parsed) {\n if (!isWin) {\n return;\n }\n\n var originalEmit = cp.emit;\n\n cp.emit = function (name, arg1) {\n // If emitting \"exit\" event and exit code is 1, we need to check if\n // the command exists and emit an \"error\" instead\n // See https://github.com/IndigoUnited/node-cross-spawn/issues/16\n if (name === 'exit') {\n var err = verifyENOENT(arg1, parsed);\n\n if (err) {\n return originalEmit.call(cp, 'error', err);\n }\n }\n\n return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n };\n}\n\nfunction verifyENOENT(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawn');\n }\n\n return null;\n}\n\nfunction verifyENOENTSync(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawnSync');\n }\n\n return null;\n}\n\nvar enoent$1 = {\n hookChildProcess: hookChildProcess,\n verifyENOENT: verifyENOENT,\n verifyENOENTSync: verifyENOENTSync,\n notFoundError: notFoundError\n};\nvar cp = require$$0__default$2[\"default\"];\nvar parse = parse_1;\nvar enoent = enoent$1;\n\nfunction spawn(command, args, options) {\n // Parse the arguments\n var parsed = parse(command, args, options); // Spawn the child process\n\n var spawned = cp.spawn(parsed.command, parsed.args, parsed.options); // Hook into child process \"exit\" event to emit an error if the command\n // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n\n enoent.hookChildProcess(spawned, parsed);\n return spawned;\n}\n\nfunction spawnSync(command, args, options) {\n // Parse the arguments\n var parsed = parse(command, args, options); // Spawn the child process\n\n var result = cp.spawnSync(parsed.command, parsed.args, parsed.options); // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n\n result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);\n return result;\n}\n\ncrossSpawn.exports = spawn;\nvar spawn_1 = crossSpawn.exports.spawn = spawn;\nvar sync = crossSpawn.exports.sync = spawnSync;\n\nvar _parse = crossSpawn.exports._parse = parse;\n\nvar _enoent = crossSpawn.exports._enoent = enoent;\n\nexports._enoent = _enoent;\nexports._parse = _parse;\nexports[\"default\"] = crossSpawn.exports;\nexports.spawn = spawn_1;\nexports.sync = sync;\n"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","Object","defineProperty","exports","value","require$$0$2","require","require$$0$1","require$$0","require$$5","_interopDefaultLegacy","e","require$$0__default$2","require$$0__default$1","require$$0__default","require$$5__default","commonjsGlobal","globalThis","window","global","self","crossSpawn","src","fn","windows","hasRequiredWindows","requireWindows","isexe","sync","fs","checkPathExt","path","options","pathext","pathExt","undefined","process","env","PATHEXT","split","indexOf","i","length","p","toLowerCase","substr","checkStat","stat","isSymbolicLink","isFile","cb","er","statSync","mode","hasRequiredMode","requireMode","checkMode","mod","uid","gid","myUid","getuid","myGid","getgid","u","parseInt","g","o","ug","ret","core","platform","TESTING_WINDOWS","isexe_1","isexe$1","sync$1","Promise","TypeError","resolve","reject","is","code","ignoreErrors","which_1","which$1","whichSync","isWindows","OSTYPE","path$2","COLON","getNotFoundError","cmd","Error","getPathInfo","opt","colon","pathEnv","PATH","pathExtExe","unshift","cwd","match","ext","extExe","info","found","F","l","all","pathPart","charAt","slice","join","test","E","ii","ll","push","j","cur","ex","nothrow","pathKey$1","opts","keys","find","x","toUpperCase","path$1","which","pathKey","resolveCommandAttempt","parsed","withoutPathExt","hasCustomCwd","chdir","err","resolved","command","delimiter","resolveCommand$1","resolveCommand_1","_escape","metaCharsRegExp","escapeCommand","arg","replace","escapeArgument","doubleEscapeMetaChars","concat","argument","shebangRegex$1","shebangRegex","shebangCommand$1","str","arr","bin","pop","shebangCommand","readShebang$1","size","buffer","Buffer","alloc","fill","fd","openSync","readSync","closeSync","toString","readShebang_1","niceTry","resolveCommand","escape","readShebang","semver","isWin$1","isExecutableRegExp","isCmdShimRegExp","supportsShellOption","satisfies","version","detectShebang","file","shebang","args","NODES","parseNonShell","commandFile","needsShell","basename","forceShell","needsDoubleEscapeMetaChars","normalize","map","shellCommand","comspec","windowsVerbatimArguments","parseShell","shell","parse$1","Array","isArray","assign","original","parse_1","isWin","notFoundError","syscall","errno","spawnargs","hookChildProcess","cp","originalEmit","emit","name","arg1","verifyENOENT","call","apply","arguments","status","verifyENOENTSync","enoent$1","parse","enoent","spawn","spawned","spawnSync","result","error","spawn_1","_parse","_enoent"],"mappings":"AAAA;AAEA,SAASA,QAAQC,GAAG;IAAI;IAA2B,OAAOD,UAAU,cAAc,OAAOE,UAAU,YAAY,OAAOA,OAAOC,QAAQ,GAAG,iBAAUF,GAAG;QAAI,OAAO,OAAOA;IAAK,IAA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/F;IACjC,OAAO+F;AACT;AAEA,SAASC,UAAU1F,OAAO,EAAE+C,IAAI,EAAEzJ,OAAO;IACvC,sBAAsB;IACtB,IAAIoG,SAAS4F,MAAMtF,SAAS+C,MAAMzJ,UAAU,0BAA0B;IAEtE,IAAIqM,SAASjB,GAAGgB,SAAS,CAAChG,OAAOM,OAAO,EAAEN,OAAOqD,IAAI,EAAErD,OAAOpG,OAAO,GAAG,yGAAyG;IAEjLqM,OAAOC,KAAK,GAAGD,OAAOC,KAAK,IAAIL,OAAOH,gBAAgB,CAACO,OAAOR,MAAM,EAAEzF;IACtE,OAAOiG;AACT;AAEAhN,WAAWlB,OAAO,GAAG+N;AACrB,IAAIK,UAAUlN,WAAWlB,OAAO,CAAC+N,KAAK,GAAGA;AACzC,IAAItM,OAAOP,WAAWlB,OAAO,CAACyB,IAAI,GAAGwM;AAErC,IAAII,SAASnN,WAAWlB,OAAO,CAACqO,MAAM,GAAGR;AAEzC,IAAIS,UAAUpN,WAAWlB,OAAO,CAACsO,OAAO,GAAGR;AAE3C9N,QAAQsO,OAAO,GAAGA;AAClBtO,QAAQqO,MAAM,GAAGA;AACjBrO,OAAO,CAAC,UAAU,GAAGkB,WAAWlB,OAAO;AACvCA,QAAQ+N,KAAK,GAAGK;AAChBpO,QAAQyB,IAAI,GAAGA"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ require("./polyfills");
3
+ module.exports = require("./spawnCallback");
4
+ module.exports.spawn = require("./spawnCallback");
5
+ module.exports.sync = require("./spawnSyncCallback");
6
+
7
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
8
+ Object.defineProperty(exports.default, '__esModule', { value: true });
9
+ for (var key in exports) exports.default[key] = exports[key];
10
+ module.exports = exports.default;
11
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["require('./polyfills');\n\nmodule.exports = require('./spawnCallback');\nmodule.exports.spawn = require('./spawnCallback');\nmodule.exports.sync = require('./spawnSyncCallback');\n"],"names":["require","module","exports","spawn","sync"],"mappings":";AAAAA,QAAQ;AAERC,OAAOC,OAAO,GAAGF,QAAQ;AACzBC,OAAOC,OAAO,CAACC,KAAK,GAAGH,QAAQ;AAC/BC,OAAOC,OAAO,CAACE,IAAI,GAAGJ,QAAQ"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ require("core-js/actual/object/assign");
3
+ require("core-js/actual/object/keys");
4
+ require("core-js/actual/array/find");
5
+ require("buffer-v6-polyfill");
6
+ var path = require("path");
7
+ if (!path.delimiter) path.delimiter = process.platform === "win32" ? ";" : ":";
8
+ var cp = require("child_process");
9
+ if (!cp.spawnSync) {
10
+ var spawnCallback = path.join(__dirname, "spawnCallback.js");
11
+ var functionExec = null; // break dependencies
12
+ cp.spawnSync = function spawnSyncPolyfill(cmd, args, options) {
13
+ if (!functionExec) functionExec = require("function-exec-sync");
14
+ return functionExec({
15
+ callbacks: true
16
+ }, spawnCallback, cmd, args, options || {});
17
+ };
18
+ }
19
+
20
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
21
+ Object.defineProperty(exports.default, '__esModule', { value: true });
22
+ for (var key in exports) exports.default[key] = exports[key];
23
+ module.exports = exports.default;
24
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["polyfills.js"],"sourcesContent":["require('core-js/actual/object/assign');\nrequire('core-js/actual/object/keys');\nrequire('core-js/actual/array/find');\nrequire('buffer-v6-polyfill');\n\nvar path = require('path');\nif (!path.delimiter) path.delimiter = process.platform === 'win32' ? ';' : ':';\n\nvar cp = require('child_process');\nif (!cp.spawnSync) {\n var spawnCallback = path.join(__dirname, 'spawnCallback.js');\n\n var functionExec = null; // break dependencies\n cp.spawnSync = function spawnSyncPolyfill(cmd, args, options) {\n if (!functionExec) functionExec = require('function-exec-sync');\n\n return functionExec({ callbacks: true }, spawnCallback, cmd, args, options || {});\n };\n}\n"],"names":["require","path","delimiter","process","platform","cp","spawnSync","spawnCallback","join","__dirname","functionExec","spawnSyncPolyfill","cmd","args","options","callbacks"],"mappings":";AAAAA,QAAQ;AACRA,QAAQ;AACRA,QAAQ;AACRA,QAAQ;AAER,IAAIC,OAAOD,QAAQ;AACnB,IAAI,CAACC,KAAKC,SAAS,EAAED,KAAKC,SAAS,GAAGC,QAAQC,QAAQ,KAAK,UAAU,MAAM;AAE3E,IAAIC,KAAKL,QAAQ;AACjB,IAAI,CAACK,GAAGC,SAAS,EAAE;IACjB,IAAIC,gBAAgBN,KAAKO,IAAI,CAACC,WAAW;IAEzC,IAAIC,eAAe,MAAM,qBAAqB;IAC9CL,GAAGC,SAAS,GAAG,SAASK,kBAAkBC,GAAG,EAAEC,IAAI,EAAEC,OAAO;QAC1D,IAAI,CAACJ,cAAcA,eAAeV,QAAQ;QAE1C,OAAOU,aAAa;YAAEK,WAAW;QAAK,GAAGR,eAAeK,KAAKC,MAAMC,WAAW,CAAC;IACjF;AACF"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ require("./polyfills");
3
+ var once = require("once");
4
+ var nextTick = require("next-tick");
5
+ var constants = require("./constants");
6
+ var major = +process.versions.node.split(".")[0];
7
+ var spawn = major <= 7 ? require("./cross-spawn-6.0.5").spawn : require("cross-spawn").spawn;
8
+ module.exports = function spawnCallback(command, args, options, callback) {
9
+ if (typeof options === "function") {
10
+ callback = options;
11
+ options = {};
12
+ }
13
+ options = options || {};
14
+ callback = once(callback);
15
+ var cp = spawn(command, args, options);
16
+ // collect output
17
+ var res = {
18
+ stdout: null,
19
+ stderr: null
20
+ };
21
+ if (options.encoding) {
22
+ if (cp.stdout) {
23
+ res.stdout = [];
24
+ cp.stdout.on("data", res.stdout.push.bind(res.stdout));
25
+ }
26
+ if (cp.stderr) {
27
+ res.stderr = [];
28
+ cp.stderr.on("data", res.stderr.push.bind(res.stderr));
29
+ }
30
+ }
31
+ // some versions of node emit both an error and close
32
+ cp.on("error", function error(err) {
33
+ err.code === "OK" || callback(err);
34
+ });
35
+ // done
36
+ cp.on("close", function(status, signal) {
37
+ nextTick(function closeNextTick() {
38
+ // prepare result
39
+ res.pid = cp.pid;
40
+ res.status = status;
41
+ res.signal = signal;
42
+ if (res.stdout) {
43
+ res.stdout = Buffer.concat(res.stdout);
44
+ if (options.encoding !== "buffer") res.stdout = res.stdout.toString(options.encoding);
45
+ }
46
+ if (res.stderr) {
47
+ res.stderr = Buffer.concat(res.stderr);
48
+ if (options.encoding !== "buffer") res.stderr = res.stderr.toString(options.encoding);
49
+ }
50
+ res.output = [
51
+ null,
52
+ res.stdout,
53
+ res.stderr
54
+ ];
55
+ // patch: early node on windows could return null
56
+ if (res.status === null) console.log("spawnCallback null status code", res);
57
+ // res.status = res.status === null ? 0 : res.status;
58
+ // process errors
59
+ var err = res.status !== 0 ? new Error("Non-zero exit code: " + res.status) : null;
60
+ if (res.stderr && res.stderr.length) {
61
+ err = err || new Error("stderr has content");
62
+ for(var key in res){
63
+ if (constants.spawnKeys.indexOf(key) < 0) continue;
64
+ err[key] = Buffer.isBuffer(res[key]) ? res[key].toString("utf8") : res[key];
65
+ }
66
+ }
67
+ err ? callback(err) : callback(null, res);
68
+ });
69
+ });
70
+ // pipe input
71
+ if (options.input && (typeof options.input === "string" || Buffer.isBuffer(options.input))) {
72
+ cp.stdin.end(options.input);
73
+ }
74
+ };
75
+
76
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
77
+ Object.defineProperty(exports.default, '__esModule', { value: true });
78
+ for (var key in exports) exports.default[key] = exports[key];
79
+ module.exports = exports.default;
80
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["spawnCallback.js"],"sourcesContent":["require('./polyfills');\nvar once = require('once');\nvar nextTick = require('next-tick');\nvar constants = require('./constants');\n\nvar major = +process.versions.node.split('.')[0];\nvar spawn = major <= 7 ? require('./cross-spawn-6.0.5').spawn : require('cross-spawn').spawn;\n\nmodule.exports = function spawnCallback(command, args, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n\n var cp = spawn(command, args, options);\n\n // collect output\n var res = { stdout: null, stderr: null };\n if (options.encoding) {\n if (cp.stdout) {\n res.stdout = [];\n cp.stdout.on('data', res.stdout.push.bind(res.stdout));\n }\n if (cp.stderr) {\n res.stderr = [];\n cp.stderr.on('data', res.stderr.push.bind(res.stderr));\n }\n }\n\n // some versions of node emit both an error and close\n cp.on('error', function error(err) {\n err.code === 'OK' || callback(err);\n });\n\n // done\n cp.on('close', function (status, signal) {\n nextTick(function closeNextTick() {\n // prepare result\n res.pid = cp.pid;\n res.status = status;\n res.signal = signal;\n if (res.stdout) {\n res.stdout = Buffer.concat(res.stdout);\n if (options.encoding !== 'buffer') res.stdout = res.stdout.toString(options.encoding);\n }\n if (res.stderr) {\n res.stderr = Buffer.concat(res.stderr);\n if (options.encoding !== 'buffer') res.stderr = res.stderr.toString(options.encoding);\n }\n res.output = [null, res.stdout, res.stderr];\n\n // patch: early node on windows could return null\n if (res.status === null) console.log('spawnCallback null status code', res);\n // res.status = res.status === null ? 0 : res.status;\n\n // process errors\n var err = res.status !== 0 ? new Error('Non-zero exit code: ' + res.status) : null;\n if (res.stderr && res.stderr.length) {\n err = err || new Error('stderr has content');\n for (var key in res) {\n if (constants.spawnKeys.indexOf(key) < 0) continue;\n err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];\n }\n }\n err ? callback(err) : callback(null, res);\n });\n });\n\n // pipe input\n if (options.input && (typeof options.input === 'string' || Buffer.isBuffer(options.input))) {\n cp.stdin.end(options.input);\n }\n};\n"],"names":["require","once","nextTick","constants","major","process","versions","node","split","spawn","module","exports","spawnCallback","command","args","options","callback","cp","res","stdout","stderr","encoding","on","push","bind","error","err","code","status","signal","closeNextTick","pid","Buffer","concat","toString","output","console","log","Error","length","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,QAAQ6B,KAAK,IAAK,CAAA,OAAO7B,QAAQ6B,KAAK,KAAK,YAAYZ,OAAOW,QAAQ,CAAC5B,QAAQ6B,KAAK,CAAA,GAAI;QAC1F3B,GAAG4B,KAAK,CAACC,GAAG,CAAC/B,QAAQ6B,KAAK;IAC5B;AACF"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var constants = require("./constants");
3
+ var major = +process.versions.node.split(".")[0];
4
+ var spawnSync = major <= 7 ? require("./cross-spawn-6.0.5").sync : require("cross-spawn").sync;
5
+ module.exports = function spawnSyncCallback(command, args, options) {
6
+ options = options || {};
7
+ var syncOptions = Object.assign({}, options || {}, {
8
+ env: options.env || process.env,
9
+ stdio: "pipe",
10
+ encoding: "utf8"
11
+ });
12
+ var res = spawnSync(command, args, syncOptions);
13
+ // patch: early node on windows could return null
14
+ if (res.status === null) console.log("spawnSyncCallback null status code", res);
15
+ // res.status = res.status === null ? 0 : res.status;
16
+ // pipe if inherited
17
+ if (res.stdout && (options.stdout === "inherit" || options.stdio === "inherit")) {
18
+ process.stdout.write(res.stdout);
19
+ res.stdout = null;
20
+ }
21
+ if (res.stderr && (options.stderr === "inherit" || options.stdio === "inherit")) {
22
+ process.stderr.write(res.stderr);
23
+ res.stderr = null;
24
+ }
25
+ // process errors
26
+ var err = res.status !== 0 ? new Error("Non-zero exit code: " + res.status) : null;
27
+ if (res.stderr && res.stderr.length) {
28
+ err = err || new Error("stderr has content");
29
+ for(var key in res){
30
+ if (constants.spawnKeys.indexOf(key) < 0) continue;
31
+ err[key] = Buffer.isBuffer(res[key]) ? res[key].toString("utf8") : res[key];
32
+ }
33
+ }
34
+ if (err) throw err;
35
+ return res;
36
+ };
37
+
38
+ if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
39
+ Object.defineProperty(exports.default, '__esModule', { value: true });
40
+ for (var key in exports) exports.default[key] = exports[key];
41
+ module.exports = exports.default;
42
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["spawnSyncCallback.js"],"sourcesContent":["var constants = require('./constants');\n\nvar major = +process.versions.node.split('.')[0];\nvar spawnSync = major <= 7 ? require('./cross-spawn-6.0.5').sync : require('cross-spawn').sync;\n\nmodule.exports = function spawnSyncCallback(command, args, options) {\n options = options || {};\n var syncOptions = Object.assign({}, options || {}, {\n env: options.env || process.env,\n stdio: 'pipe',\n encoding: 'utf8',\n });\n\n var res = spawnSync(command, args, syncOptions);\n\n // patch: early node on windows could return null\n if (res.status === null) console.log('spawnSyncCallback null status code', res);\n // res.status = res.status === null ? 0 : res.status;\n\n // pipe if inherited\n if (res.stdout && (options.stdout === 'inherit' || options.stdio === 'inherit')) {\n process.stdout.write(res.stdout);\n res.stdout = null;\n }\n if (res.stderr && (options.stderr === 'inherit' || options.stdio === 'inherit')) {\n process.stderr.write(res.stderr);\n res.stderr = null;\n }\n\n // process errors\n var err = res.status !== 0 ? new Error('Non-zero exit code: ' + res.status) : null;\n if (res.stderr && res.stderr.length) {\n err = err || new Error('stderr has content');\n for (var key in res) {\n if (constants.spawnKeys.indexOf(key) < 0) continue;\n err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];\n }\n }\n if (err) throw err;\n return res;\n};\n"],"names":["constants","require","major","process","versions","node","split","spawnSync","sync","module","exports","spawnSyncCallback","command","args","options","syncOptions","Object","assign","env","stdio","encoding","res","status","console","log","stdout","write","stderr","err","Error","length","key","spawnKeys","indexOf","Buffer","isBuffer","toString"],"mappings":";AAAA,IAAIA,YAAYC,QAAQ;AAExB,IAAIC,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAChD,IAAIC,YAAYL,SAAS,IAAID,QAAQ,uBAAuBO,IAAI,GAAGP,QAAQ,eAAeO,IAAI;AAE9FC,OAAOC,OAAO,GAAG,SAASC,kBAAkBC,OAAO,EAAEC,IAAI,EAAEC,OAAO;IAChEA,UAAUA,WAA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@
1
+ export const __esModule: boolean;
2
+ export default crossSpawn.exports;
3
+ export namespace _enoent {
4
+ export { hookChildProcess };
5
+ export { verifyENOENT };
6
+ export { verifyENOENTSync };
7
+ export { notFoundError };
8
+ }
9
+ export function _parse(command: any, args: any, options: any): any;
10
+ declare function exports(command: any, args: any, options: any): any;
11
+ declare namespace crossSpawn { }
12
+ declare function spawn_1(command: any, args: any, options: any): any;
13
+ export function sync(command: any, args: any, options: any): any;
14
+ declare function hookChildProcess(cp: any, parsed: any): void;
15
+ declare function verifyENOENT(status: any, parsed: any): Error & {
16
+ code: string;
17
+ errno: string;
18
+ syscall: string;
19
+ path: any;
20
+ spawnargs: any;
21
+ };
22
+ declare function verifyENOENTSync(status: any, parsed: any): Error & {
23
+ code: string;
24
+ errno: string;
25
+ syscall: string;
26
+ path: any;
27
+ spawnargs: any;
28
+ };
29
+ declare function notFoundError(original: any, syscall: any): Error & {
30
+ code: string;
31
+ errno: string;
32
+ syscall: string;
33
+ path: any;
34
+ spawnargs: any;
35
+ };
36
+ export { spawn_1 as spawn };
@@ -0,0 +1,6 @@
1
+ declare function _exports(command: any, args: any, options: any, callback: any): void;
2
+ declare namespace _exports {
3
+ let spawn: (command: any, args: any, options: any, callback: any) => void;
4
+ let sync: (command: any, args: any, options: any) => any;
5
+ }
6
+ export = _exports;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ declare function _exports(command: any, args: any, options: any, callback: any): void;
2
+ export = _exports;
@@ -0,0 +1,2 @@
1
+ declare function _exports(command: any, args: any, options: any): any;
2
+ export = _exports;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-spawn-cb",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "description": "Cross spawn with a completion callback",
5
5
  "keywords": [
6
6
  "cross-spawn",
@@ -12,54 +12,49 @@
12
12
  "url": "git@github.com:kmalakoff/cross-spawn-cb.git"
13
13
  },
14
14
  "license": "MIT",
15
- "main": "lib/index.js",
15
+ "main": "dist/cjs/index.js",
16
+ "types": "dist/types/index.d.ts",
16
17
  "files": [
17
- "lib"
18
+ "dist"
18
19
  ],
19
20
  "scripts": {
20
- "build": "",
21
- "build:spawn": "rollup -c config/rollup.cs.config.js",
22
- "format": "prettier --write .",
23
- "lint": "eslint .",
24
- "prepublishOnly": "npm run lint && depcheck",
25
- "test": "mocha-compat test/spec/**/*.test.js --no-timeouts",
26
- "test:engines": "nvu engines npm test"
21
+ "build": "tsds build",
22
+ "deploy": "tsds deploy",
23
+ "format": "biome check --apply src/ test/",
24
+ "test": "tsds test:node --timeout=40000",
25
+ "test:engines": "nvu engines tsds test:node --timeout=40000",
26
+ "version": "tsds version"
27
27
  },
28
28
  "dependencies": {
29
29
  "buffer-v6-polyfill": "^1.0.5",
30
- "core-js": "^3.24.1",
30
+ "core-js": "^3.35.1",
31
31
  "cross-spawn": "^7.0.3",
32
- "function-exec-sync": "^0.2.9",
32
+ "function-exec-sync": "^0.2.11",
33
33
  "next-tick": "^1.1.0",
34
- "once": "^1.4.0"
34
+ "once": "^1.4.0",
35
+ "semver": "^5.7.1"
35
36
  },
36
37
  "devDependencies": {
37
- "@babel/preset-env": "^7.18.10",
38
- "@rollup/plugin-babel": "^5.3.1",
39
- "@rollup/plugin-commonjs": "^22.0.2",
40
- "@rollup/plugin-node-resolve": "^13.3.0",
41
- "@typescript-eslint/parser": "^5.32.0",
38
+ "@biomejs/biome": "^1.5.3",
39
+ "@types/mocha": "^10.0.6",
42
40
  "cr": "^0.1.0",
43
- "depcheck": "^1.4.3",
44
- "eslint": "^8.21.0",
45
- "eslint-config-prettier": "^8.5.0",
46
- "eslint-config-standard": "^17.0.0",
47
- "eslint-plugin-import": "^2.26.0",
48
- "eslint-plugin-promise": "^6.0.0",
41
+ "depcheck": "^1.4.7",
49
42
  "is-version": "^0.2.1",
50
43
  "lodash.find": "^4.6.0",
51
44
  "match-semver": "^0.1.1",
52
45
  "mocha-compat": "^3.5.5",
53
- "node-install-release": "^0.3.16",
54
- "node-version-utils": "^0.5.5",
55
- "prettier": "^2.7.1",
56
- "rollup": "^2.77.2",
57
- "rollup-plugin-babel": "^4.4.0",
58
- "rollup-plugin-commonjs": "^10.1.0",
59
- "rollup-plugin-node-externals": "^4.1.1",
60
- "semver": "^5.7.1"
46
+ "node-install-release": "^0.4.7",
47
+ "node-resolve-versions": "^0.3.9",
48
+ "node-version-utils": "^0.5.6",
49
+ "ts-dev-stack": "^0.9.2"
61
50
  },
62
51
  "engines": {
63
52
  "node": ">=0.8"
53
+ },
54
+ "tsds": {
55
+ "source": "src/index.js",
56
+ "targets": [
57
+ "cjs"
58
+ ]
64
59
  }
65
60
  }
package/lib/constants.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- spawnKeys: ['pid', 'status', 'signal', 'stdout', 'stderr', 'output'],
3
- };