cross-spawn-cb 0.6.16 → 0.6.17
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.
- package/dist/cjs/cross-spawn-6.0.5.js +570 -0
- package/dist/cjs/cross-spawn-6.0.5.js.map +1 -0
- package/dist/cjs/spawnCallback.js +1 -1
- package/dist/cjs/spawnCallback.js.map +1 -1
- package/dist/cjs/spawnSyncCallback.js +1 -1
- package/dist/cjs/spawnSyncCallback.js.map +1 -1
- package/dist/types/cross-spawn-6.0.5.d.ts +36 -0
- package/package.json +2 -3
- package/assets/cross-spawn-6.0.5.js +0 -677
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _typeof(obj) {
|
|
3
|
+
"@babel/helpers - typeof";
|
|
4
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) {
|
|
5
|
+
return typeof obj;
|
|
6
|
+
} : function(obj) {
|
|
7
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
8
|
+
}, _typeof(obj);
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11
|
+
value: true
|
|
12
|
+
});
|
|
13
|
+
var require$$0$2 = require("child_process");
|
|
14
|
+
var require$$0$1 = require("path");
|
|
15
|
+
var require$$0 = require("fs");
|
|
16
|
+
var require$$5 = require("semver");
|
|
17
|
+
function _interopDefaultLegacy(e) {
|
|
18
|
+
return e && _typeof(e) === "object" && "default" in e ? e : {
|
|
19
|
+
"default": e
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
var require$$0__default$2 = /*#__PURE__*/ _interopDefaultLegacy(require$$0$2);
|
|
23
|
+
var require$$0__default$1 = /*#__PURE__*/ _interopDefaultLegacy(require$$0$1);
|
|
24
|
+
var require$$0__default = /*#__PURE__*/ _interopDefaultLegacy(require$$0);
|
|
25
|
+
var require$$5__default = /*#__PURE__*/ _interopDefaultLegacy(require$$5);
|
|
26
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
27
|
+
var crossSpawn = {
|
|
28
|
+
exports: {}
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Tries to execute a function and discards any error that occurs.
|
|
32
|
+
* @param {Function} fn - Function that might or might not throw an error.
|
|
33
|
+
* @returns {?*} Return-value of the function when no error occurred.
|
|
34
|
+
*/ var src = function src(fn) {
|
|
35
|
+
try {
|
|
36
|
+
return fn();
|
|
37
|
+
} catch (e) {}
|
|
38
|
+
};
|
|
39
|
+
var windows;
|
|
40
|
+
var hasRequiredWindows;
|
|
41
|
+
function requireWindows() {
|
|
42
|
+
if (hasRequiredWindows) return windows;
|
|
43
|
+
hasRequiredWindows = 1;
|
|
44
|
+
windows = isexe;
|
|
45
|
+
isexe.sync = sync;
|
|
46
|
+
var fs = require$$0__default["default"];
|
|
47
|
+
function checkPathExt(path, options) {
|
|
48
|
+
var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;
|
|
49
|
+
if (!pathext) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
pathext = pathext.split(";");
|
|
53
|
+
if (pathext.indexOf("") !== -1) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
for(var i = 0; i < pathext.length; i++){
|
|
57
|
+
var p = pathext[i].toLowerCase();
|
|
58
|
+
if (p && path.substr(-p.length).toLowerCase() === p) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
function checkStat(stat, path, options) {
|
|
65
|
+
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return checkPathExt(path, options);
|
|
69
|
+
}
|
|
70
|
+
function isexe(path, options, cb) {
|
|
71
|
+
fs.stat(path, function(er, stat) {
|
|
72
|
+
cb(er, er ? false : checkStat(stat, path, options));
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function sync(path, options) {
|
|
76
|
+
return checkStat(fs.statSync(path), path, options);
|
|
77
|
+
}
|
|
78
|
+
return windows;
|
|
79
|
+
}
|
|
80
|
+
var mode;
|
|
81
|
+
var hasRequiredMode;
|
|
82
|
+
function requireMode() {
|
|
83
|
+
if (hasRequiredMode) return mode;
|
|
84
|
+
hasRequiredMode = 1;
|
|
85
|
+
mode = isexe;
|
|
86
|
+
isexe.sync = sync;
|
|
87
|
+
var fs = require$$0__default["default"];
|
|
88
|
+
function isexe(path, options, cb) {
|
|
89
|
+
fs.stat(path, function(er, stat) {
|
|
90
|
+
cb(er, er ? false : checkStat(stat, options));
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function sync(path, options) {
|
|
94
|
+
return checkStat(fs.statSync(path), options);
|
|
95
|
+
}
|
|
96
|
+
function checkStat(stat, options) {
|
|
97
|
+
return stat.isFile() && checkMode(stat, options);
|
|
98
|
+
}
|
|
99
|
+
function checkMode(stat, options) {
|
|
100
|
+
var mod = stat.mode;
|
|
101
|
+
var uid = stat.uid;
|
|
102
|
+
var gid = stat.gid;
|
|
103
|
+
var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
|
|
104
|
+
var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
|
|
105
|
+
var u = parseInt("100", 8);
|
|
106
|
+
var g = parseInt("010", 8);
|
|
107
|
+
var o = parseInt("001", 8);
|
|
108
|
+
var ug = u | g;
|
|
109
|
+
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
110
|
+
return ret;
|
|
111
|
+
}
|
|
112
|
+
return mode;
|
|
113
|
+
}
|
|
114
|
+
var core;
|
|
115
|
+
if (process.platform === "win32" || commonjsGlobal.TESTING_WINDOWS) {
|
|
116
|
+
core = requireWindows();
|
|
117
|
+
} else {
|
|
118
|
+
core = requireMode();
|
|
119
|
+
}
|
|
120
|
+
var isexe_1 = isexe$1;
|
|
121
|
+
isexe$1.sync = sync$1;
|
|
122
|
+
function isexe$1(path, options, cb) {
|
|
123
|
+
if (typeof options === "function") {
|
|
124
|
+
cb = options;
|
|
125
|
+
options = {};
|
|
126
|
+
}
|
|
127
|
+
if (!cb) {
|
|
128
|
+
if (typeof Promise !== "function") {
|
|
129
|
+
throw new TypeError("callback not provided");
|
|
130
|
+
}
|
|
131
|
+
return new Promise(function(resolve, reject) {
|
|
132
|
+
isexe$1(path, options || {}, function(er, is) {
|
|
133
|
+
if (er) {
|
|
134
|
+
reject(er);
|
|
135
|
+
} else {
|
|
136
|
+
resolve(is);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
core(path, options || {}, function(er, is) {
|
|
142
|
+
// ignore EACCES because that just means we aren't allowed to run it
|
|
143
|
+
if (er) {
|
|
144
|
+
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
145
|
+
er = null;
|
|
146
|
+
is = false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
cb(er, is);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function sync$1(path, options) {
|
|
153
|
+
// my kingdom for a filtered catch
|
|
154
|
+
try {
|
|
155
|
+
return core.sync(path, options || {});
|
|
156
|
+
} catch (er) {
|
|
157
|
+
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
158
|
+
return false;
|
|
159
|
+
} else {
|
|
160
|
+
throw er;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
var which_1 = which$1;
|
|
165
|
+
which$1.sync = whichSync;
|
|
166
|
+
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
167
|
+
var path$2 = require$$0__default$1["default"];
|
|
168
|
+
var COLON = isWindows ? ";" : ":";
|
|
169
|
+
var isexe = isexe_1;
|
|
170
|
+
function getNotFoundError(cmd) {
|
|
171
|
+
var er = new Error("not found: " + cmd);
|
|
172
|
+
er.code = "ENOENT";
|
|
173
|
+
return er;
|
|
174
|
+
}
|
|
175
|
+
function getPathInfo(cmd, opt) {
|
|
176
|
+
var colon = opt.colon || COLON;
|
|
177
|
+
var pathEnv = opt.path || process.env.PATH || "";
|
|
178
|
+
var pathExt = [
|
|
179
|
+
""
|
|
180
|
+
];
|
|
181
|
+
pathEnv = pathEnv.split(colon);
|
|
182
|
+
var pathExtExe = "";
|
|
183
|
+
if (isWindows) {
|
|
184
|
+
pathEnv.unshift(process.cwd());
|
|
185
|
+
pathExtExe = opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM";
|
|
186
|
+
pathExt = pathExtExe.split(colon); // Always test the cmd itself first. isexe will check to make sure
|
|
187
|
+
// it's found in the pathExt set.
|
|
188
|
+
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift("");
|
|
189
|
+
} // If it has a slash, then we don't bother searching the pathenv.
|
|
190
|
+
// just check the file itself, and that's it.
|
|
191
|
+
if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) pathEnv = [
|
|
192
|
+
""
|
|
193
|
+
];
|
|
194
|
+
return {
|
|
195
|
+
env: pathEnv,
|
|
196
|
+
ext: pathExt,
|
|
197
|
+
extExe: pathExtExe
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function which$1(cmd, opt, cb) {
|
|
201
|
+
if (typeof opt === "function") {
|
|
202
|
+
cb = opt;
|
|
203
|
+
opt = {};
|
|
204
|
+
}
|
|
205
|
+
var info = getPathInfo(cmd, opt);
|
|
206
|
+
var pathEnv = info.env;
|
|
207
|
+
var pathExt = info.ext;
|
|
208
|
+
var pathExtExe = info.extExe;
|
|
209
|
+
var found = [];
|
|
210
|
+
(function F(i, l) {
|
|
211
|
+
if (i === l) {
|
|
212
|
+
if (opt.all && found.length) return cb(null, found);
|
|
213
|
+
else return cb(getNotFoundError(cmd));
|
|
214
|
+
}
|
|
215
|
+
var pathPart = pathEnv[i];
|
|
216
|
+
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') pathPart = pathPart.slice(1, -1);
|
|
217
|
+
var p = path$2.join(pathPart, cmd);
|
|
218
|
+
if (!pathPart && /^\.[\\\/]/.test(cmd)) {
|
|
219
|
+
p = cmd.slice(0, 2) + p;
|
|
220
|
+
}
|
|
221
|
+
(function E(ii, ll) {
|
|
222
|
+
if (ii === ll) return F(i + 1, l);
|
|
223
|
+
var ext = pathExt[ii];
|
|
224
|
+
isexe(p + ext, {
|
|
225
|
+
pathExt: pathExtExe
|
|
226
|
+
}, function(er, is) {
|
|
227
|
+
if (!er && is) {
|
|
228
|
+
if (opt.all) found.push(p + ext);
|
|
229
|
+
else return cb(null, p + ext);
|
|
230
|
+
}
|
|
231
|
+
return E(ii + 1, ll);
|
|
232
|
+
});
|
|
233
|
+
})(0, pathExt.length);
|
|
234
|
+
})(0, pathEnv.length);
|
|
235
|
+
}
|
|
236
|
+
function whichSync(cmd, opt) {
|
|
237
|
+
opt = opt || {};
|
|
238
|
+
var info = getPathInfo(cmd, opt);
|
|
239
|
+
var pathEnv = info.env;
|
|
240
|
+
var pathExt = info.ext;
|
|
241
|
+
var pathExtExe = info.extExe;
|
|
242
|
+
var found = [];
|
|
243
|
+
for(var i = 0, l = pathEnv.length; i < l; i++){
|
|
244
|
+
var pathPart = pathEnv[i];
|
|
245
|
+
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') pathPart = pathPart.slice(1, -1);
|
|
246
|
+
var p = path$2.join(pathPart, cmd);
|
|
247
|
+
if (!pathPart && /^\.[\\\/]/.test(cmd)) {
|
|
248
|
+
p = cmd.slice(0, 2) + p;
|
|
249
|
+
}
|
|
250
|
+
for(var j = 0, ll = pathExt.length; j < ll; j++){
|
|
251
|
+
var cur = p + pathExt[j];
|
|
252
|
+
var is;
|
|
253
|
+
try {
|
|
254
|
+
is = isexe.sync(cur, {
|
|
255
|
+
pathExt: pathExtExe
|
|
256
|
+
});
|
|
257
|
+
if (is) {
|
|
258
|
+
if (opt.all) found.push(cur);
|
|
259
|
+
else return cur;
|
|
260
|
+
}
|
|
261
|
+
} catch (ex) {}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (opt.all && found.length) return found;
|
|
265
|
+
if (opt.nothrow) return null;
|
|
266
|
+
throw getNotFoundError(cmd);
|
|
267
|
+
}
|
|
268
|
+
var pathKey$1 = function pathKey$1(opts) {
|
|
269
|
+
opts = opts || {};
|
|
270
|
+
var env = opts.env || process.env;
|
|
271
|
+
var platform = opts.platform || process.platform;
|
|
272
|
+
if (platform !== "win32") {
|
|
273
|
+
return "PATH";
|
|
274
|
+
}
|
|
275
|
+
return Object.keys(env).find(function(x) {
|
|
276
|
+
return x.toUpperCase() === "PATH";
|
|
277
|
+
}) || "Path";
|
|
278
|
+
};
|
|
279
|
+
var path$1 = require$$0__default$1["default"];
|
|
280
|
+
var which = which_1;
|
|
281
|
+
var pathKey = pathKey$1();
|
|
282
|
+
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
283
|
+
var cwd = process.cwd();
|
|
284
|
+
var hasCustomCwd = parsed.options.cwd != null; // If a custom `cwd` was specified, we need to change the process cwd
|
|
285
|
+
// because `which` will do stat calls but does not support a custom cwd
|
|
286
|
+
if (hasCustomCwd) {
|
|
287
|
+
try {
|
|
288
|
+
process.chdir(parsed.options.cwd);
|
|
289
|
+
} catch (err) {
|
|
290
|
+
/* Empty */ }
|
|
291
|
+
}
|
|
292
|
+
var resolved;
|
|
293
|
+
try {
|
|
294
|
+
resolved = which.sync(parsed.command, {
|
|
295
|
+
path: (parsed.options.env || process.env)[pathKey],
|
|
296
|
+
pathExt: withoutPathExt ? path$1.delimiter : undefined
|
|
297
|
+
});
|
|
298
|
+
} catch (e) {
|
|
299
|
+
/* Empty */ } finally{
|
|
300
|
+
process.chdir(cwd);
|
|
301
|
+
} // If we successfully resolved, ensure that an absolute path is returned
|
|
302
|
+
// Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
|
|
303
|
+
if (resolved) {
|
|
304
|
+
resolved = path$1.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
305
|
+
}
|
|
306
|
+
return resolved;
|
|
307
|
+
}
|
|
308
|
+
function resolveCommand$1(parsed) {
|
|
309
|
+
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
310
|
+
}
|
|
311
|
+
var resolveCommand_1 = resolveCommand$1;
|
|
312
|
+
var _escape = {}; // See http://www.robvanderwoude.com/escapechars.php
|
|
313
|
+
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
314
|
+
function escapeCommand(arg) {
|
|
315
|
+
// Escape meta chars
|
|
316
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
317
|
+
return arg;
|
|
318
|
+
}
|
|
319
|
+
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
320
|
+
// Convert to string
|
|
321
|
+
arg = "".concat(arg); // Algorithm below is based on https://qntm.org/cmd
|
|
322
|
+
// Sequence of backslashes followed by a double quote:
|
|
323
|
+
// double up all the backslashes and escape the double quote
|
|
324
|
+
arg = arg.replace(/(\\*)"/g, '$1$1\\"'); // Sequence of backslashes followed by the end of the string
|
|
325
|
+
// (which will become a double quote later):
|
|
326
|
+
// double up all the backslashes
|
|
327
|
+
arg = arg.replace(/(\\*)$/, "$1$1"); // All other backslashes occur literally
|
|
328
|
+
// Quote the whole thing:
|
|
329
|
+
arg = '"'.concat(arg, '"'); // Escape meta chars
|
|
330
|
+
arg = arg.replace(metaCharsRegExp, "^$1"); // Double escape meta chars if necessary
|
|
331
|
+
if (doubleEscapeMetaChars) {
|
|
332
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
333
|
+
}
|
|
334
|
+
return arg;
|
|
335
|
+
}
|
|
336
|
+
_escape.command = escapeCommand;
|
|
337
|
+
_escape.argument = escapeArgument;
|
|
338
|
+
var shebangRegex$1 = /^#!.*/;
|
|
339
|
+
var shebangRegex = shebangRegex$1;
|
|
340
|
+
var shebangCommand$1 = function shebangCommand$1(str) {
|
|
341
|
+
var match = str.match(shebangRegex);
|
|
342
|
+
if (!match) {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
var arr = match[0].replace(/#! ?/, "").split(" ");
|
|
346
|
+
var bin = arr[0].split("/").pop();
|
|
347
|
+
var arg = arr[1];
|
|
348
|
+
return bin === "env" ? arg : bin + (arg ? " " + arg : "");
|
|
349
|
+
};
|
|
350
|
+
var fs = require$$0__default["default"];
|
|
351
|
+
var shebangCommand = shebangCommand$1;
|
|
352
|
+
function readShebang$1(command) {
|
|
353
|
+
// Read the first 150 bytes from the file
|
|
354
|
+
var size = 150;
|
|
355
|
+
var buffer;
|
|
356
|
+
if (Buffer.alloc) {
|
|
357
|
+
// Node.js v4.5+ / v5.10+
|
|
358
|
+
buffer = Buffer.alloc(size);
|
|
359
|
+
} else {
|
|
360
|
+
// Old Node.js API
|
|
361
|
+
buffer = new Buffer(size);
|
|
362
|
+
buffer.fill(0); // zero-fill
|
|
363
|
+
}
|
|
364
|
+
var fd;
|
|
365
|
+
try {
|
|
366
|
+
fd = fs.openSync(command, "r");
|
|
367
|
+
fs.readSync(fd, buffer, 0, size, 0);
|
|
368
|
+
fs.closeSync(fd);
|
|
369
|
+
} catch (e) {
|
|
370
|
+
/* Empty */ } // Attempt to extract shebang (null is returned if not a shebang)
|
|
371
|
+
return shebangCommand(buffer.toString());
|
|
372
|
+
}
|
|
373
|
+
var readShebang_1 = readShebang$1;
|
|
374
|
+
var path = require$$0__default$1["default"];
|
|
375
|
+
var niceTry = src;
|
|
376
|
+
var resolveCommand = resolveCommand_1;
|
|
377
|
+
var escape = _escape;
|
|
378
|
+
var readShebang = readShebang_1;
|
|
379
|
+
var semver = require$$5__default["default"];
|
|
380
|
+
var isWin$1 = process.platform === "win32";
|
|
381
|
+
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
382
|
+
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
|
|
383
|
+
var supportsShellOption = niceTry(function() {
|
|
384
|
+
return semver.satisfies(process.version, "^4.8.0 || ^5.7.0 || >= 6.0.0", true);
|
|
385
|
+
}) || false;
|
|
386
|
+
function detectShebang(parsed) {
|
|
387
|
+
parsed.file = resolveCommand(parsed);
|
|
388
|
+
var shebang = parsed.file && readShebang(parsed.file);
|
|
389
|
+
if (shebang) {
|
|
390
|
+
parsed.args.unshift(parsed.file);
|
|
391
|
+
parsed.command = shebang;
|
|
392
|
+
return resolveCommand(parsed);
|
|
393
|
+
}
|
|
394
|
+
return parsed.file;
|
|
395
|
+
}
|
|
396
|
+
var NODES = [
|
|
397
|
+
"node",
|
|
398
|
+
"node.exe",
|
|
399
|
+
"node.cmd"
|
|
400
|
+
];
|
|
401
|
+
function parseNonShell(parsed) {
|
|
402
|
+
if (!isWin$1) {
|
|
403
|
+
return parsed;
|
|
404
|
+
} // Detect & add support for shebangs
|
|
405
|
+
var commandFile = detectShebang(parsed); // We don't need a shell if the command filename is an executable
|
|
406
|
+
var needsShell = !isExecutableRegExp.test(commandFile); // If a shell is required, use cmd.exe and take care of escaping everything correctly
|
|
407
|
+
// Note that `forceShell` is an hidden option used only in tests
|
|
408
|
+
// KM: force node to use the shell
|
|
409
|
+
if (!needsShell && NODES.indexOf(path.basename(commandFile).toLowerCase()) >= 0) needsShell = true;
|
|
410
|
+
if (parsed.options.forceShell || needsShell) {
|
|
411
|
+
// Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
|
|
412
|
+
// The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
|
|
413
|
+
// Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
|
|
414
|
+
// we need to double escape them
|
|
415
|
+
var needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
|
|
416
|
+
// This is necessary otherwise it will always fail with ENOENT in those cases
|
|
417
|
+
parsed.command = path.normalize(parsed.command); // Escape command & arguments
|
|
418
|
+
parsed.command = escape.command(parsed.command);
|
|
419
|
+
parsed.args = parsed.args.map(function(arg) {
|
|
420
|
+
return escape.argument(arg, needsDoubleEscapeMetaChars);
|
|
421
|
+
});
|
|
422
|
+
var shellCommand = [
|
|
423
|
+
parsed.command
|
|
424
|
+
].concat(parsed.args).join(" ");
|
|
425
|
+
parsed.args = [
|
|
426
|
+
"/d",
|
|
427
|
+
"/s",
|
|
428
|
+
"/c",
|
|
429
|
+
'"'.concat(shellCommand, '"')
|
|
430
|
+
];
|
|
431
|
+
parsed.command = process.env.comspec || "cmd.exe";
|
|
432
|
+
parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
|
|
433
|
+
}
|
|
434
|
+
return parsed;
|
|
435
|
+
}
|
|
436
|
+
function parseShell(parsed) {
|
|
437
|
+
// If node supports the shell option, there's no need to mimic its behavior
|
|
438
|
+
if (supportsShellOption) {
|
|
439
|
+
return parsed;
|
|
440
|
+
} // Mimic node shell option
|
|
441
|
+
// See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
|
|
442
|
+
var shellCommand = [
|
|
443
|
+
parsed.command
|
|
444
|
+
].concat(parsed.args).join(" ");
|
|
445
|
+
if (isWin$1) {
|
|
446
|
+
parsed.command = typeof parsed.options.shell === "string" ? parsed.options.shell : process.env.comspec || "cmd.exe";
|
|
447
|
+
parsed.args = [
|
|
448
|
+
"/d",
|
|
449
|
+
"/s",
|
|
450
|
+
"/c",
|
|
451
|
+
'"'.concat(shellCommand, '"')
|
|
452
|
+
];
|
|
453
|
+
parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
|
|
454
|
+
} else {
|
|
455
|
+
if (typeof parsed.options.shell === "string") {
|
|
456
|
+
parsed.command = parsed.options.shell;
|
|
457
|
+
} else if (process.platform === "android") {
|
|
458
|
+
parsed.command = "/system/bin/sh";
|
|
459
|
+
} else {
|
|
460
|
+
parsed.command = "/bin/sh";
|
|
461
|
+
}
|
|
462
|
+
parsed.args = [
|
|
463
|
+
"-c",
|
|
464
|
+
shellCommand
|
|
465
|
+
];
|
|
466
|
+
}
|
|
467
|
+
return parsed;
|
|
468
|
+
}
|
|
469
|
+
function parse$1(command, args, options) {
|
|
470
|
+
// Normalize arguments, similar to nodejs
|
|
471
|
+
if (args && !Array.isArray(args)) {
|
|
472
|
+
options = args;
|
|
473
|
+
args = null;
|
|
474
|
+
}
|
|
475
|
+
args = args ? args.slice(0) : []; // Clone array to avoid changing the original
|
|
476
|
+
options = Object.assign({}, options); // Clone object to avoid changing the original
|
|
477
|
+
// Build our parsed object
|
|
478
|
+
var parsed = {
|
|
479
|
+
command: command,
|
|
480
|
+
args: args,
|
|
481
|
+
options: options,
|
|
482
|
+
file: undefined,
|
|
483
|
+
original: {
|
|
484
|
+
command: command,
|
|
485
|
+
args: args
|
|
486
|
+
}
|
|
487
|
+
}; // Delegate further parsing to shell or non-shell
|
|
488
|
+
return options.shell ? parseShell(parsed) : parseNonShell(parsed);
|
|
489
|
+
}
|
|
490
|
+
var parse_1 = parse$1;
|
|
491
|
+
var isWin = process.platform === "win32";
|
|
492
|
+
function notFoundError(original, syscall) {
|
|
493
|
+
return Object.assign(new Error("".concat(syscall, " ").concat(original.command, " ENOENT")), {
|
|
494
|
+
code: "ENOENT",
|
|
495
|
+
errno: "ENOENT",
|
|
496
|
+
syscall: "".concat(syscall, " ").concat(original.command),
|
|
497
|
+
path: original.command,
|
|
498
|
+
spawnargs: original.args
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
function hookChildProcess(cp, parsed) {
|
|
502
|
+
if (!isWin) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
var originalEmit = cp.emit;
|
|
506
|
+
cp.emit = function(name, arg1) {
|
|
507
|
+
// If emitting "exit" event and exit code is 1, we need to check if
|
|
508
|
+
// the command exists and emit an "error" instead
|
|
509
|
+
// See https://github.com/IndigoUnited/node-cross-spawn/issues/16
|
|
510
|
+
if (name === "exit") {
|
|
511
|
+
var err = verifyENOENT(arg1, parsed);
|
|
512
|
+
if (err) {
|
|
513
|
+
return originalEmit.call(cp, "error", err);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
function verifyENOENT(status, parsed) {
|
|
520
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
521
|
+
return notFoundError(parsed.original, "spawn");
|
|
522
|
+
}
|
|
523
|
+
return null;
|
|
524
|
+
}
|
|
525
|
+
function verifyENOENTSync(status, parsed) {
|
|
526
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
527
|
+
return notFoundError(parsed.original, "spawnSync");
|
|
528
|
+
}
|
|
529
|
+
return null;
|
|
530
|
+
}
|
|
531
|
+
var enoent$1 = {
|
|
532
|
+
hookChildProcess: hookChildProcess,
|
|
533
|
+
verifyENOENT: verifyENOENT,
|
|
534
|
+
verifyENOENTSync: verifyENOENTSync,
|
|
535
|
+
notFoundError: notFoundError
|
|
536
|
+
};
|
|
537
|
+
var cp = require$$0__default$2["default"];
|
|
538
|
+
var parse = parse_1;
|
|
539
|
+
var enoent = enoent$1;
|
|
540
|
+
function spawn(command, args, options) {
|
|
541
|
+
// Parse the arguments
|
|
542
|
+
var parsed = parse(command, args, options); // Spawn the child process
|
|
543
|
+
var spawned = cp.spawn(parsed.command, parsed.args, parsed.options); // Hook into child process "exit" event to emit an error if the command
|
|
544
|
+
// does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
|
|
545
|
+
enoent.hookChildProcess(spawned, parsed);
|
|
546
|
+
return spawned;
|
|
547
|
+
}
|
|
548
|
+
function spawnSync(command, args, options) {
|
|
549
|
+
// Parse the arguments
|
|
550
|
+
var parsed = parse(command, args, options); // Spawn the child process
|
|
551
|
+
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
|
|
552
|
+
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
553
|
+
return result;
|
|
554
|
+
}
|
|
555
|
+
crossSpawn.exports = spawn;
|
|
556
|
+
var spawn_1 = crossSpawn.exports.spawn = spawn;
|
|
557
|
+
var sync = crossSpawn.exports.sync = spawnSync;
|
|
558
|
+
var _parse = crossSpawn.exports._parse = parse;
|
|
559
|
+
var _enoent = crossSpawn.exports._enoent = enoent;
|
|
560
|
+
exports._enoent = _enoent;
|
|
561
|
+
exports._parse = _parse;
|
|
562
|
+
exports["default"] = crossSpawn.exports;
|
|
563
|
+
exports.spawn = spawn_1;
|
|
564
|
+
exports.sync = sync;
|
|
565
|
+
|
|
566
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
567
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
568
|
+
for (var key in exports) exports.default[key] = exports[key];
|
|
569
|
+
module.exports = exports.default;
|
|
570
|
+
}
|
|
@@ -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,IAAI,SAAUA,GAAG;QAAI,OAAOA,OAAO,cAAc,OAAOC,UAAUD,IAAIG,WAAW,KAAKF,UAAUD,QAAQC,OAAOG,SAAS,GAAG,WAAW,OAAOJ;IAAK,GAAGD,QAAQC;AAAM;AAE/UK,OAAOC,cAAc,CAACC,SAAS,cAAc;IAC3CC,OAAO;AACT;AAEA,IAAIC,eAAeC,QAAQ;AAE3B,IAAIC,eAAeD,QAAQ;AAE3B,IAAIE,aAAaF,QAAQ;AAEzB,IAAIG,aAAaH,QAAQ;AAEzB,SAASI,sBAAsBC,CAAC;IAC9B,OAAOA,KAAKhB,QAAQgB,OAAO,YAAY,aAAaA,IAAIA,IAAI;QAC1D,WAAWA;IACb;AACF;AAEA,IAAIC,wBAAwB,WAAW,GAAEF,sBAAsBL;AAE/D,IAAIQ,wBAAwB,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,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"}
|
|
@@ -4,7 +4,7 @@ var once = require("once");
|
|
|
4
4
|
var nextTick = require("next-tick");
|
|
5
5
|
var constants = require("./constants");
|
|
6
6
|
var major = +process.versions.node.split(".")[0];
|
|
7
|
-
var spawn = major <= 7 ? require("
|
|
7
|
+
var spawn = major <= 7 ? require("./cross-spawn-6.0.5.js").spawn : require("cross-spawn").spawn;
|
|
8
8
|
module.exports = function spawnCallback(command, args, options, callback) {
|
|
9
9
|
if (typeof options === "function") {
|
|
10
10
|
callback = options;
|