cross-spawn-cb 1.4.0 → 1.4.2
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/assets/cross-spawn-6.0.5.js +35 -12
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/spawn.js +1 -1
- package/dist/cjs/spawn.js.map +1 -1
- package/dist/cjs/spawnCallback.js.map +1 -1
- package/dist/cjs/spawnCallbackSync.js.map +1 -1
- package/package.json +5 -6
|
@@ -11,6 +11,10 @@ function getDefaultExportFromCjs(x) {
|
|
|
11
11
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
var src$1 = {
|
|
15
|
+
exports: {}
|
|
16
|
+
};
|
|
17
|
+
|
|
14
18
|
var es_object_assign = {};
|
|
15
19
|
|
|
16
20
|
function _type_of$6(obj) {
|
|
@@ -2145,21 +2149,21 @@ var crossSpawn6_0_5 = {
|
|
|
2145
2149
|
exports: {}
|
|
2146
2150
|
};
|
|
2147
2151
|
|
|
2148
|
-
var src
|
|
2152
|
+
var src;
|
|
2149
2153
|
var hasRequiredSrc$1;
|
|
2150
2154
|
function requireSrc$1() {
|
|
2151
|
-
if (hasRequiredSrc$1) return src
|
|
2155
|
+
if (hasRequiredSrc$1) return src;
|
|
2152
2156
|
hasRequiredSrc$1 = 1;
|
|
2153
2157
|
/**
|
|
2154
2158
|
* Tries to execute a function and discards any error that occurs.
|
|
2155
2159
|
* @param {Function} fn - Function that might or might not throw an error.
|
|
2156
2160
|
* @returns {?*} Return-value of the function when no error occurred.
|
|
2157
|
-
*/ src
|
|
2161
|
+
*/ src = function src(fn) {
|
|
2158
2162
|
try {
|
|
2159
2163
|
return fn();
|
|
2160
2164
|
} catch (e) {}
|
|
2161
2165
|
};
|
|
2162
|
-
return src
|
|
2166
|
+
return src;
|
|
2163
2167
|
}
|
|
2164
2168
|
|
|
2165
2169
|
var windows;
|
|
@@ -3870,10 +3874,6 @@ function requireParse() {
|
|
|
3870
3874
|
var commandFile = detectShebang(parsed);
|
|
3871
3875
|
// We don't need a shell if the command filename is an executable
|
|
3872
3876
|
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
|
-
|
|
3877
3877
|
// If a shell is required, use cmd.exe and take care of escaping everything correctly
|
|
3878
3878
|
// Note that `forceShell` is an hidden option used only in tests
|
|
3879
3879
|
if (parsed.options.forceShell || needsShell) {
|
|
@@ -4052,10 +4052,9 @@ function requireCrossSpawn6_0_5() {
|
|
|
4052
4052
|
return crossSpawn6_0_5.exports;
|
|
4053
4053
|
}
|
|
4054
4054
|
|
|
4055
|
-
var src;
|
|
4056
4055
|
var hasRequiredSrc;
|
|
4057
4056
|
function requireSrc() {
|
|
4058
|
-
if (hasRequiredSrc) return src;
|
|
4057
|
+
if (hasRequiredSrc) return src$1.exports;
|
|
4059
4058
|
hasRequiredSrc = 1;
|
|
4060
4059
|
requireAssign();
|
|
4061
4060
|
requireKeys();
|
|
@@ -4079,8 +4078,32 @@ function requireSrc() {
|
|
|
4079
4078
|
}, spawnCallback, cmd, args, options || {});
|
|
4080
4079
|
};
|
|
4081
4080
|
}
|
|
4082
|
-
|
|
4083
|
-
|
|
4081
|
+
var NODES = [
|
|
4082
|
+
'node',
|
|
4083
|
+
'node.exe',
|
|
4084
|
+
'node.cmd'
|
|
4085
|
+
];
|
|
4086
|
+
function patchNode(command, _args, options) {
|
|
4087
|
+
if (NODES.indexOf(path.basename(command).toLowerCase()) < 0) return command;
|
|
4088
|
+
if (typeof options === 'function') {
|
|
4089
|
+
callback = options;
|
|
4090
|
+
options = {};
|
|
4091
|
+
}
|
|
4092
|
+
options = options || {};
|
|
4093
|
+
var env = options.env || process.env;
|
|
4094
|
+
return env.NODE || env.npm_node_execpath;
|
|
4095
|
+
}
|
|
4096
|
+
var spawn = requireCrossSpawn6_0_5();
|
|
4097
|
+
function spawnCompat(command, args, options, callback1) {
|
|
4098
|
+
return spawn.spawn(patchNode(command, args, options), args, options, callback1);
|
|
4099
|
+
}
|
|
4100
|
+
function spawnSyncCompat(command, args, options) {
|
|
4101
|
+
return spawn.sync(patchNode(command, args, options), args, options);
|
|
4102
|
+
}
|
|
4103
|
+
spawnCompat.sync = spawnSyncCompat;
|
|
4104
|
+
src$1.exports = spawnCompat;
|
|
4105
|
+
src$1.exports.spawn = spawnCompat;
|
|
4106
|
+
return src$1.exports;
|
|
4084
4107
|
}
|
|
4085
4108
|
|
|
4086
4109
|
var srcExports = requireSrc();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["constants.js"],"sourcesContent":["module.exports = {\n spawnKeys: ['pid', 'status', 'signal', 'stdout', 'stderr', 'output'],\n};\n"],"names":["module","exports","spawnKeys"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACfC,WAAW;QAAC;QAAO;QAAU;QAAU;QAAU;QAAU;KAAS;AACtE"}
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/@compat/cross-spawn-cb/src/constants.js"],"sourcesContent":["module.exports = {\n spawnKeys: ['pid', 'status', 'signal', 'stdout', 'stderr', 'output'],\n};\n"],"names":["module","exports","spawnKeys"],"mappings":";AAAAA,OAAOC,OAAO,GAAG;IACfC,WAAW;QAAC;QAAO;QAAU;QAAU;QAAU;QAAU;KAAS;AACtE"}
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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"}
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/@compat/cross-spawn-cb/src/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,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var major = +process.versions.node.split('.')[0];
|
|
3
|
-
var spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5
|
|
3
|
+
var spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5').spawn : require('cross-spawn').spawn;
|
|
4
4
|
module.exports = spawn;
|
|
5
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];\nconst spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/@compat/cross-spawn-cb/src/spawn.js"],"sourcesContent":["const major = +process.versions.node.split('.')[0];\nconst spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5').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,kCAAkCD,KAAK,GAAGC,QAAQ,eAAeD,KAAK;AACzGE,OAAOC,OAAO,GAAGH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["spawnCallback.js"],"sourcesContent":["const once = require('call-once-fn');\nconst nextTick = require('next-tick');\nconst constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(cp, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n\n // collect output\n const 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', (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) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const 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\nfunction spawnCallback(command, args, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n const cp = spawn(command, args, options);\n return normalize(cp, options, callback);\n}\n\nmodule.exports = spawnCallback;\nmodule.exports.normalize = normalize;\n"],"names":["once","require","nextTick","constants","spawn","normalize","cp","options","callback","res","stdout","stderr","encoding","on","push","bind","error","err","code","status","signal","closeNextTick","pid","Buffer","concat","toString","output","Error","key","spawnKeys","indexOf","isBuffer","input","stdin","end","spawnCallback","command","args","module","exports"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,WAAWD,QAAQ;AACzB,IAAME,YAAYF,QAAQ;AAC1B,IAAMG,QAAQH,QAAQ;AAEtB,SAASI,UAAUC,EAAE,EAAEC,OAAO,EAAEC,QAAQ;IACtC,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWR,KAAKQ;IAEhB,iBAAiB;IACjB,IAAMC,MAAM;QAAEC,QAAQ;QAAMC,QAAQ;IAAK;IACzC,IAAIJ,QAAQK,QAAQ,EAAE;QACpB,IAAIN,GAAGI,MAAM,EAAE;YACbD,IAAIC,MAAM,GAAG,EAAE;YACfJ,GAAGI,MAAM,CAACG,EAAE,CAAC,QAAQJ,IAAIC,MAAM,CAACI,IAAI,CAACC,IAAI,CAACN,IAAIC,MAAM;QACtD;QACA,IAAIJ,GAAGK,MAAM,EAAE;YACbF,IAAIE,MAAM,GAAG,EAAE;YACfL,GAAGK,MAAM,CAACE,EAAE,CAAC,QAAQJ,IAAIE,MAAM,CAACG,IAAI,CAACC,IAAI,CAACN,IAAIE,MAAM;QACtD;IACF;IAEA,qDAAqD;IACrDL,GAAGO,EAAE,CAAC,SAAS,SAASG,MAAMC,GAAG;QAC/BA,IAAIC,IAAI,KAAK,QAAQV,SAASS;I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IAAIF,QAAQyB,KAAK,IAAK,CAAA,OAAOzB,QAAQyB,KAAK,KAAK,YAAYT,OAAOQ,QAAQ,CAACxB,QAAQyB,KAAK,CAAA,GAAI;QAC1F1B,GAAG2B,KAAK,CAACC,GAAG,CAAC3B,QAAQyB,KAAK;IAC5B;AACF;AAEA,SAASG,cAAcC,OAAO,EAAEC,IAAI,EAAE9B,OAAO,EAAEC,QAAQ;IACrD,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWR,KAAKQ;IAChB,IAAMF,KAAKF,MAAMgC,SAASC,MAAM9B;IAChC,OAAOF,UAAUC,IAAIC,SAASC;AAChC;AAEA8B,OAAOC,OAAO,GAAGJ;AACjBG,OAAOC,OAAO,CAAClC,SAAS,GAAGA"}
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/@compat/cross-spawn-cb/src/spawnCallback.js"],"sourcesContent":["const once = require('call-once-fn');\nconst nextTick = require('next-tick');\nconst constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(cp, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n\n // collect output\n const 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', (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) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const 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\nfunction spawnCallback(command, args, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n const cp = spawn(command, args, options);\n return normalize(cp, options, callback);\n}\n\nmodule.exports = spawnCallback;\nmodule.exports.normalize = normalize;\n"],"names":["once","require","nextTick","constants","spawn","normalize","cp","options","callback","res","stdout","stderr","encoding","on","push","bind","error","err","code","status","signal","closeNextTick","pid","Buffer","concat","toString","output","Error","key","spawnKeys","indexOf","isBuffer","input","stdin","end","spawnCallback","command","args","module","exports"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,WAAWD,QAAQ;AACzB,IAAME,YAAYF,QAAQ;AAC1B,IAAMG,QAAQH,QAAQ;AAEtB,SAASI,UAAUC,EAAE,EAAEC,OAAO,EAAEC,QAAQ;IACtC,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWR,KAAKQ;IAEhB,iBAAiB;IACjB,IAAMC,MAAM;QAAEC,QAAQ;QAAMC,QAAQ;IAAK;IACzC,IAAIJ,QAAQK,QAAQ,EAAE;QACpB,IAAIN,GAAGI,MAAM,EAAE;YACbD,IAAIC,MAAM,GAAG,EAAE;YACfJ,GAAGI,MAAM,CAACG,EAAE,CAAC,QAAQ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M,KAAM;YAChF,IAAIF,KAAK;gBACP,IAAK,IAAMW,OAAOnB,IAAK;oBACrB,IAAIN,UAAU0B,SAAS,CAACC,OAAO,CAACF,OAAO,GAAG;oBAC1CX,GAAG,CAACW,IAAI,GAAGL,OAAOQ,QAAQ,CAACtB,GAAG,CAACmB,IAAI,IAAInB,GAAG,CAACmB,IAAI,CAACH,QAAQ,CAAC,UAAUhB,GAAG,CAACmB,IAAI;gBAC7E;YACF;YACAX,MAAMT,SAASS,OAAOT,SAAS,MAAMC;QACvC;IACF;IAEA,aAAa;IACb,IAAIF,QAAQyB,KAAK,IAAK,CAAA,OAAOzB,QAAQyB,KAAK,KAAK,YAAYT,OAAOQ,QAAQ,CAACxB,QAAQyB,KAAK,CAAA,GAAI;QAC1F1B,GAAG2B,KAAK,CAACC,GAAG,CAAC3B,QAAQyB,KAAK;IAC5B;AACF;AAEA,SAASG,cAAcC,OAAO,EAAEC,IAAI,EAAE9B,OAAO,EAAEC,QAAQ;IACrD,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWR,KAAKQ;IAChB,IAAMF,KAAKF,MAAMgC,SAASC,MAAM9B;IAChC,OAAOF,UAAUC,IAAIC,SAASC;AAChC;AAEA8B,OAAOC,OAAO,GAAGJ;AACjBG,OAAOC,OAAO,CAAClC,SAAS,GAAGA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["spawnCallbackSync.js"],"sourcesContent":["const constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(res, options) {\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 // patch: early node on windows could return null\n if (res.status === null) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const 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\nfunction spawnCallbackSync(command, args, options) {\n options = options || {};\n const syncOptions = { ...options, env: options.env || process.env, stdio: 'pipe', encoding: 'utf8' };\n const res = spawn.sync(command, args, syncOptions);\n return normalize(res, options);\n}\n\nmodule.exports = spawnCallbackSync;\nmodule.exports.normalize = normalize;\n"],"names":["constants","require","spawn","normalize","res","options","stdout","stdio","process","write","stderr","status","err","Error","key","spawnKeys","indexOf","Buffer","isBuffer","toString","spawnCallbackSync","command","args","syncOptions","env","encoding","sync","module","exports"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,YAAYC,QAAQ;AAC1B,IAAMC,QAAQD,QAAQ;AAEtB,SAASE,UAAUC,GAAG,EAAEC,OAAO;IAC7B,oBAAoB;IACpB,IAAID,IAAIE,MAAM,IAAKD,CAAAA,QAAQC,MAAM,KAAK,aAAaD,QAAQE,KAAK,KAAK,SAAQ,GAAI;QAC/EC,QAAQF,MAAM,CAACG,KAAK,CAACL,IAAIE,MAAM;QAC/BF,IAAIE,MAAM,GAAG;IACf;IACA,IAAIF,IAAIM,MAAM,IAAKL,CAAAA,QAAQK,MAAM,KAAK,aAAaL,QAAQE,KAAK,KAAK,SAAQ,GAAI;QAC/EC,QAAQE,MAAM,CAACD,KAAK,CAACL,IAAIM,MAAM;QAC/BN,IAAIM,MAAM,GAAG;IACf;IAEA,iDAAiD;IACjD,IAAIN,IAAIO,MAAM,KAAK,MAAMP,IAAIO,MAAM,GAAG;IAEtC,iBAAiB;IACjB,IAAMC,MAAMR,IAAIO,MAAM,KAAK,IAAI,IAAIE,MAAM,AAAC,uBAAiC,OAAXT,IAAIO,MAAM,KAAM;IAChF,IAAIC,KAAK;QACP,IAAK,IAAME,OAAOV,IAAK;YACrB,IAAIJ,UAAUe,SAAS,CAACC,OAAO,CAACF,OAAO,GAAG;YAC1CF,GAAG,CAACE,IAAI,GAAGG,OAAOC,QAAQ,CAACd,GAAG,CAACU,IAAI,IAAIV,GAAG,CAACU,IAAI,CAACK,QAAQ,CAAC,UAAUf,GAAG,CAACU,IAAI;QAC7E;IACF;IACA,IAAIF,KAAK,MAAMA;IACf,OAAOR;AACT;AAEA,SAASgB,kBAAkBC,OAAO,EAAEC,IAAI,EAAEjB,OAAO;IAC/CA,UAAUA,WAAW,CAAC;IACtB,IAAMkB,cAAc,wCAAKlB;QAASmB,KAAKnB,QAAQmB,GAAG,IAAIhB,QAAQgB,GAAG;QAAEjB,OAAO;QAAQkB,UAAU;;IAC5F,IAAMrB,MAAMF,MAAMwB,IAAI,CAACL,SAASC,MAAMC;IACtC,OAAOpB,UAAUC,KAAKC;AACxB;AAEAsB,OAAOC,OAAO,GAAGR;AACjBO,OAAOC,OAAO,CAACzB,SAAS,GAAGA"}
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/@compat/cross-spawn-cb/src/spawnCallbackSync.js"],"sourcesContent":["const constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(res, options) {\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 // patch: early node on windows could return null\n if (res.status === null) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const 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\nfunction spawnCallbackSync(command, args, options) {\n options = options || {};\n const syncOptions = { ...options, env: options.env || process.env, stdio: 'pipe', encoding: 'utf8' };\n const res = spawn.sync(command, args, syncOptions);\n return normalize(res, options);\n}\n\nmodule.exports = spawnCallbackSync;\nmodule.exports.normalize = normalize;\n"],"names":["constants","require","spawn","normalize","res","options","stdout","stdio","process","write","stderr","status","err","Error","key","spawnKeys","indexOf","Buffer","isBuffer","toString","spawnCallbackSync","command","args","syncOptions","env","encoding","sync","module","exports"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,YAAYC,QAAQ;AAC1B,IAAMC,QAAQD,QAAQ;AAEtB,SAASE,UAAUC,GAAG,EAAEC,OAAO;IAC7B,oBAAoB;IACpB,IAAID,IAAIE,MAAM,IAAKD,CAAAA,QAAQC,MAAM,KAAK,aAAaD,QAAQE,KAAK,KAAK,SAAQ,GAAI;QAC/EC,QAAQF,MAAM,CAACG,KAAK,CAACL,IAAIE,MAAM;QAC/BF,IAAIE,MAAM,GAAG;IACf;IACA,IAAIF,IAAIM,MAAM,IAAKL,CAAAA,QAAQK,MAAM,KAAK,aAAaL,QAAQE,KAAK,KAAK,SAAQ,GAAI;QAC/EC,QAAQE,MAAM,CAACD,KAAK,CAACL,IAAIM,MAAM;QAC/BN,IAAIM,MAAM,GAAG;IACf;IAEA,iDAAiD;IACjD,IAAIN,IAAIO,MAAM,KAAK,MAAMP,IAAIO,MAAM,GAAG;IAEtC,iBAAiB;IACjB,IAAMC,MAAMR,IAAIO,MAAM,KAAK,IAAI,IAAIE,MAAM,AAAC,uBAAiC,OAAXT,IAAIO,MAAM,KAAM;IAChF,IAAIC,KAAK;QACP,IAAK,IAAME,OAAOV,IAAK;YACrB,IAAIJ,UAAUe,SAAS,CAACC,OAAO,CAACF,OAAO,GAAG;YAC1CF,GAAG,CAACE,IAAI,GAAGG,OAAOC,QAAQ,CAACd,GAAG,CAACU,IAAI,IAAIV,GAAG,CAACU,IAAI,CAACK,QAAQ,CAAC,UAAUf,GAAG,CAACU,IAAI;QAC7E;IACF;IACA,IAAIF,KAAK,MAAMA;IACf,OAAOR;AACT;AAEA,SAASgB,kBAAkBC,OAAO,EAAEC,IAAI,EAAEjB,OAAO;IAC/CA,UAAUA,WAAW,CAAC;IACtB,IAAMkB,cAAc,wCAAKlB;QAASmB,KAAKnB,QAAQmB,GAAG,IAAIhB,QAAQgB,GAAG;QAAEjB,OAAO;QAAQkB,UAAU;;IAC5F,IAAMrB,MAAMF,MAAMwB,IAAI,CAACL,SAASC,MAAMC;IACtC,OAAOpB,UAAUC,KAAKC;AACxB;AAEAsB,OAAOC,OAAO,GAAGR;AACjBO,OAAOC,OAAO,CAACzB,SAAS,GAAGA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cross-spawn-cb",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Cross spawn with a completion callback",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-spawn",
|
|
@@ -40,13 +40,12 @@
|
|
|
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.5.
|
|
44
|
-
"node-resolve-versions": "^1.0.
|
|
45
|
-
"node-version-utils": "^1.1.
|
|
43
|
+
"node-install-release": "^1.5.1",
|
|
44
|
+
"node-resolve-versions": "^1.0.2",
|
|
45
|
+
"node-version-utils": "^1.1.2",
|
|
46
46
|
"rimraf2": "^2.8.2",
|
|
47
|
-
"ts-
|
|
47
|
+
"ts-swc-loaders": "^1.5.7"
|
|
48
48
|
},
|
|
49
|
-
"packageManager": "npm@11.0.0+sha512.11dff29565d2297c74e7c594a9762581bde969f0aa5cbe6f5b3644bf008a16c065ece61094d9ffbb81125be38df8e1ba43eb8244b3d30c61eb797e9a2440e3ec",
|
|
50
49
|
"engines": {
|
|
51
50
|
"node": ">=0.8"
|
|
52
51
|
},
|