cross-spawn-cb 1.3.0 → 1.4.0
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.
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var require$$0 = require('buffer');
|
|
4
4
|
var require$$0$2 = require('path');
|
|
5
5
|
var require$$0$3 = require('child_process');
|
|
6
|
+
var require$$6 = require('function-exec-sync');
|
|
6
7
|
var require$$0$1 = require('fs');
|
|
7
8
|
|
|
8
9
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -2140,7 +2141,7 @@ function requireBufferV6Polyfill() {
|
|
|
2140
2141
|
return bufferV6Polyfill;
|
|
2141
2142
|
}
|
|
2142
2143
|
|
|
2143
|
-
var
|
|
2144
|
+
var crossSpawn6_0_5 = {
|
|
2144
2145
|
exports: {}
|
|
2145
2146
|
};
|
|
2146
2147
|
|
|
@@ -2440,11 +2441,9 @@ function requireResolveCommand() {
|
|
|
2440
2441
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
2441
2442
|
var cwd = process.cwd();
|
|
2442
2443
|
var hasCustomCwd = parsed.options.cwd != null;
|
|
2443
|
-
// Worker threads do not have process.chdir()
|
|
2444
|
-
var shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined;
|
|
2445
2444
|
// If a custom `cwd` was specified, we need to change the process cwd
|
|
2446
2445
|
// because `which` will do stat calls but does not support a custom cwd
|
|
2447
|
-
if (
|
|
2446
|
+
if (hasCustomCwd) {
|
|
2448
2447
|
try {
|
|
2449
2448
|
process.chdir(parsed.options.cwd);
|
|
2450
2449
|
} catch (err) {
|
|
@@ -2458,9 +2457,7 @@ function requireResolveCommand() {
|
|
|
2458
2457
|
});
|
|
2459
2458
|
} catch (e) {
|
|
2460
2459
|
/* Empty */ } finally{
|
|
2461
|
-
|
|
2462
|
-
process.chdir(cwd);
|
|
2463
|
-
}
|
|
2460
|
+
process.chdir(cwd);
|
|
2464
2461
|
}
|
|
2465
2462
|
// If we successfully resolved, ensure that an absolute path is returned
|
|
2466
2463
|
// Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
|
|
@@ -2493,15 +2490,13 @@ function require_escape() {
|
|
|
2493
2490
|
// Convert to string
|
|
2494
2491
|
arg = "".concat(arg);
|
|
2495
2492
|
// Algorithm below is based on https://qntm.org/cmd
|
|
2496
|
-
// It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input
|
|
2497
|
-
// Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information
|
|
2498
2493
|
// Sequence of backslashes followed by a double quote:
|
|
2499
2494
|
// double up all the backslashes and escape the double quote
|
|
2500
|
-
arg = arg.replace(/(
|
|
2495
|
+
arg = arg.replace(/(\\*)"/g, '$1$1\\"');
|
|
2501
2496
|
// Sequence of backslashes followed by the end of the string
|
|
2502
2497
|
// (which will become a double quote later):
|
|
2503
2498
|
// double up all the backslashes
|
|
2504
|
-
arg = arg.replace(/(
|
|
2499
|
+
arg = arg.replace(/(\\*)$/, '$1$1');
|
|
2505
2500
|
// All other backslashes occur literally
|
|
2506
2501
|
// Quote the whole thing:
|
|
2507
2502
|
arg = '"'.concat(arg, '"');
|
|
@@ -3875,6 +3870,10 @@ function requireParse() {
|
|
|
3875
3870
|
var commandFile = detectShebang(parsed);
|
|
3876
3871
|
// We don't need a shell if the command filename is an executable
|
|
3877
3872
|
var needsShell = !isExecutableRegExp.test(commandFile);
|
|
3873
|
+
|
|
3874
|
+
// KM: force node to use the shell
|
|
3875
|
+
if (!needsShell && ['node', 'node.exe', 'node.cmd'].indexOf(path.basename(commandFile).toLowerCase()) >= 0) needsShell = true;
|
|
3876
|
+
|
|
3878
3877
|
// If a shell is required, use cmd.exe and take care of escaping everything correctly
|
|
3879
3878
|
// Note that `forceShell` is an hidden option used only in tests
|
|
3880
3879
|
if (parsed.options.forceShell || needsShell) {
|
|
@@ -4019,10 +4018,10 @@ function requireEnoent() {
|
|
|
4019
4018
|
return enoent;
|
|
4020
4019
|
}
|
|
4021
4020
|
|
|
4022
|
-
var
|
|
4023
|
-
function
|
|
4024
|
-
if (
|
|
4025
|
-
|
|
4021
|
+
var hasRequiredCrossSpawn6_0_5;
|
|
4022
|
+
function requireCrossSpawn6_0_5() {
|
|
4023
|
+
if (hasRequiredCrossSpawn6_0_5) return crossSpawn6_0_5.exports;
|
|
4024
|
+
hasRequiredCrossSpawn6_0_5 = 1;
|
|
4026
4025
|
var cp = require$$0$3;
|
|
4027
4026
|
var parse = requireParse();
|
|
4028
4027
|
var enoent = requireEnoent();
|
|
@@ -4045,12 +4044,12 @@ function requireCrossSpawn() {
|
|
|
4045
4044
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
4046
4045
|
return result;
|
|
4047
4046
|
}
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
return
|
|
4047
|
+
crossSpawn6_0_5.exports = spawn;
|
|
4048
|
+
crossSpawn6_0_5.exports.spawn = spawn;
|
|
4049
|
+
crossSpawn6_0_5.exports.sync = spawnSync;
|
|
4050
|
+
crossSpawn6_0_5.exports._parse = parse;
|
|
4051
|
+
crossSpawn6_0_5.exports._enoent = enoent;
|
|
4052
|
+
return crossSpawn6_0_5.exports;
|
|
4054
4053
|
}
|
|
4055
4054
|
|
|
4056
4055
|
var src;
|
|
@@ -4067,7 +4066,20 @@ function requireSrc() {
|
|
|
4067
4066
|
var isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);
|
|
4068
4067
|
path.delimiter = isWindows ? ';' : ':';
|
|
4069
4068
|
}
|
|
4070
|
-
|
|
4069
|
+
// early node is missing spawnSync
|
|
4070
|
+
var cp = require$$0$3;
|
|
4071
|
+
if (!cp.spawnSync) {
|
|
4072
|
+
var path1 = require$$0$2;
|
|
4073
|
+
var spawnCallback = path1.join(__dirname, '..', 'dist', 'cjs', 'spawnCallback.js');
|
|
4074
|
+
var functionExec = null; // break dependencies
|
|
4075
|
+
cp.spawnSync = function spawnSyncPolyfill(cmd, args, options) {
|
|
4076
|
+
if (!functionExec) functionExec = require$$6;
|
|
4077
|
+
return functionExec({
|
|
4078
|
+
callbacks: true
|
|
4079
|
+
}, spawnCallback, cmd, args, options || {});
|
|
4080
|
+
};
|
|
4081
|
+
}
|
|
4082
|
+
src = requireCrossSpawn6_0_5();
|
|
4071
4083
|
return src;
|
|
4072
4084
|
}
|
|
4073
4085
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// early node is missing spawnSync
|
|
2
1
|
"use strict";
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
3
|
value: true
|
|
@@ -28,17 +27,5 @@ function _interop_require_default(obj) {
|
|
|
28
27
|
default: obj
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
|
-
var cp = require('child_process');
|
|
32
|
-
if (!cp.spawnSync) {
|
|
33
|
-
var path = require('path');
|
|
34
|
-
var _$spawnCallback = path.join(__dirname, 'spawnCallback.js');
|
|
35
|
-
var functionExec = null; // break dependencies
|
|
36
|
-
cp.spawnSync = function spawnSyncPolyfill(cmd, args, options) {
|
|
37
|
-
if (!functionExec) functionExec = require('function-exec-sync');
|
|
38
|
-
return functionExec({
|
|
39
|
-
callbacks: true
|
|
40
|
-
}, _$spawnCallback, cmd, args, options || {});
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
30
|
var _default = _spawnCallback.default;
|
|
44
31
|
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.mjs"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["index.mjs"],"sourcesContent":["import spawnCallback from './spawnCallback';\nexport default spawnCallback;\nexport { default as spawn } from './spawn';\nexport { default as sync } from './spawnCallbackSync';\n"],"names":["spawn","sync","spawnCallback"],"mappings":";;;;;;;;;;;IACA,OAA6B;eAA7B;;IACoBA,KAAK;eAALA,cAAK;;IACLC,IAAI;eAAJA,0BAAI;;;oEAHE;4DAEO;wEACD;;;;;;IAFhC,WAAeC,sBAAa"}
|
package/dist/cjs/spawn.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var major = +process.versions.node.split('.')[0];
|
|
3
|
-
|
|
4
|
-
var spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.' + 'cjs').spawn : require('cross-spawn').spawn;
|
|
3
|
+
var spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.js').spawn : require('cross-spawn').spawn;
|
|
5
4
|
module.exports = spawn;
|
|
6
5
|
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/dist/cjs/spawn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["spawn.js"],"sourcesContent":["const major = +process.versions.node.split('.')[0];\
|
|
1
|
+
{"version":3,"sources":["spawn.js"],"sourcesContent":["const major = +process.versions.node.split('.')[0];\nconst spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.js').spawn : require('cross-spawn').spawn;\nmodule.exports = spawn;\n"],"names":["major","process","versions","node","split","spawn","require","module","exports"],"mappings":";AAAA,IAAMA,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,IAAMC,QAAQL,SAAS,IAAIM,QAAQ,qCAAqCD,KAAK,GAAGC,QAAQ,eAAeD,KAAK;AAC5GE,OAAOC,OAAO,GAAGH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cross-spawn-cb",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Cross spawn with a completion callback",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-spawn",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"call-once-fn": "^1.0.1",
|
|
31
31
|
"cross-spawn": "^7.0.6",
|
|
32
|
-
"function-exec-sync": "^1.1.
|
|
32
|
+
"function-exec-sync": "^1.1.2",
|
|
33
33
|
"next-tick": "^1.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -40,10 +40,11 @@
|
|
|
40
40
|
"depcheck": "^1.4.7",
|
|
41
41
|
"is-version": "^0.2.1",
|
|
42
42
|
"mocha-compat": "^3.6.2",
|
|
43
|
-
"node-install-release": "^1.
|
|
44
|
-
"node-resolve-versions": "^1.0.
|
|
45
|
-
"node-version-utils": "^1.0
|
|
46
|
-
"
|
|
43
|
+
"node-install-release": "^1.5.0",
|
|
44
|
+
"node-resolve-versions": "^1.0.1",
|
|
45
|
+
"node-version-utils": "^1.1.0",
|
|
46
|
+
"rimraf2": "^2.8.2",
|
|
47
|
+
"ts-dev-stack": "^1.5.4"
|
|
47
48
|
},
|
|
48
49
|
"packageManager": "npm@11.0.0+sha512.11dff29565d2297c74e7c594a9762581bde969f0aa5cbe6f5b3644bf008a16c065ece61094d9ffbb81125be38df8e1ba43eb8244b3d30c61eb797e9a2440e3ec",
|
|
49
50
|
"engines": {
|