cross-spawn-cb 0.6.15 → 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.
|
@@ -1 +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\
|
|
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\nconst path = require('path');\nif (!path.delimiter) path.delimiter = process.platform === 'win32' ? ';' : ':';\n\nconst cp = require('child_process');\nif (!cp.spawnSync) {\n const spawnCallback = path.join(__dirname, 'spawnCallback.js');\n\n let 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,IAAMC,OAAOD,QAAQ;AACrB,IAAI,CAACC,KAAKC,SAAS,EAAED,KAAKC,SAAS,GAAGC,QAAQC,QAAQ,KAAK,UAAU,MAAM;AAE3E,IAAMC,KAAKL,QAAQ;AACnB,IAAI,CAACK,GAAGC,SAAS,EAAE;IACjB,IAAMC,gBAAgBN,KAAKO,IAAI,CAACC,WAAW;IAE3C,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"}
|
|
@@ -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("./cross-spawn-6.0.5").spawn : require("cross-spawn").spawn;
|
|
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;
|
|
@@ -56,7 +56,7 @@ module.exports = function spawnCallback(command, args, options, callback) {
|
|
|
56
56
|
if (res.status === null) console.log("spawnCallback null status code", res);
|
|
57
57
|
// res.status = res.status === null ? 0 : res.status;
|
|
58
58
|
// process errors
|
|
59
|
-
var err = res.status !== 0 ? new Error("Non-zero exit code: "
|
|
59
|
+
var err = res.status !== 0 ? new Error("Non-zero exit code: ".concat(res.status)) : null;
|
|
60
60
|
if (res.stderr && res.stderr.length) {
|
|
61
61
|
err = err || new Error("stderr has content");
|
|
62
62
|
for(var key in res){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["spawnCallback.js"],"sourcesContent":["require('./polyfills');\
|
|
1
|
+
{"version":3,"sources":["spawnCallback.js"],"sourcesContent":["require('./polyfills');\nconst once = require('once');\nconst nextTick = require('next-tick');\nconst constants = require('./constants');\n\nconst major = +process.versions.node.split('.')[0];\nconst spawn = major <= 7 ? require('./cross-spawn-6.0.5.js').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 const cp = spawn(command, args, options);\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) console.log('spawnCallback null status code', res);\n // res.status = res.status === null ? 0 : res.status;\n\n // process errors\n let 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 (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"],"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","key","spawnKeys","indexOf","isBuffer","input","stdin","end"],"mappings":";AAAAA,QAAQ;AACR,IAAMC,OAAOD,QAAQ;AACrB,IAAME,WAAWF,QAAQ;AACzB,IAAMG,YAAYH,QAAQ;AAE1B,IAAMI,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,IAAMC,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
2
2
|
var constants = require("./constants");
|
|
3
3
|
var major = +process.versions.node.split(".")[0];
|
|
4
|
-
var spawnSync = major <= 7 ? require("./cross-spawn-6.0.5").sync : require("cross-spawn").sync;
|
|
4
|
+
var spawnSync = major <= 7 ? require("./cross-spawn-6.0.5.js").sync : require("cross-spawn").sync;
|
|
5
5
|
module.exports = function spawnSyncCallback(command, args, options) {
|
|
6
6
|
options = options || {};
|
|
7
7
|
var syncOptions = Object.assign({}, options || {}, {
|
|
@@ -23,7 +23,7 @@ module.exports = function spawnSyncCallback(command, args, options) {
|
|
|
23
23
|
res.stderr = null;
|
|
24
24
|
}
|
|
25
25
|
// process errors
|
|
26
|
-
var err = res.status !== 0 ? new Error("Non-zero exit code: "
|
|
26
|
+
var err = res.status !== 0 ? new Error("Non-zero exit code: ".concat(res.status)) : null;
|
|
27
27
|
if (res.stderr && res.stderr.length) {
|
|
28
28
|
err = err || new Error("stderr has content");
|
|
29
29
|
for(var key in res){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["spawnSyncCallback.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["spawnSyncCallback.js"],"sourcesContent":["const constants = require('./constants');\n\nconst major = +process.versions.node.split('.')[0];\nconst spawnSync = major <= 7 ? require('./cross-spawn-6.0.5.js').sync : require('cross-spawn').sync;\n\nmodule.exports = function spawnSyncCallback(command, args, options) {\n options = options || {};\n const syncOptions = Object.assign({}, options || {}, {\n env: options.env || process.env,\n stdio: 'pipe',\n encoding: 'utf8',\n });\n\n const 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 let 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 (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"],"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,IAAMA,YAAYC,QAAQ;AAE1B,IAAMC,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,IAAMC,YAAYL,SAAS,IAAID,QAAQ,0BAA0BO,IAAI,GAAGP,QAAQ,eAAeO,IAAI;AAEnGC,OAAOC,OAAO,GAAG,SAASC,kBAAkBC,OAAO,EAAEC,IAAI,EAAEC,OAAO;IAChEA,UAAUA,WAAW,CAAC;IACtB,IAAMC,cAAcC,OAAOC,MAAM,CAAC,CAAC,GAAGH,WAAW,CAAC,GAAG;QACnDI,KAAKJ,QAAQI,GAAG,IAAIf,QAAQe,GAAG;QAC/BC,OAAO;QACPC,UAAU;IACZ;IAEA,IAAMC,MAAMd,UAAUK,SAASC,MAAME;IAErC,iDAAiD;IACjD,IAAIM,IAAIC,MAAM,KAAK,MAAMC,QAAQC,GAAG,CAAC,sCAAsCH;IAC3E,qDAAqD;IAErD,oBAAoB;IACpB,IAAIA,IAAII,MAAM,IAAKX,CAAAA,QAAQW,MAAM,KAAK,aAAaX,QAAQK,KAAK,KAAK,SAAQ,GAAI;QAC/EhB,QAAQsB,MAAM,CAACC,KAAK,CAACL,IAAII,MAAM;QAC/BJ,IAAII,MAAM,GAAG;IACf;IACA,IAAIJ,IAAIM,MAAM,IAAKb,CAAAA,QAAQa,MAAM,KAAK,aAAab,QAAQK,KAAK,KAAK,SAAQ,GAAI;QAC/EhB,QAAQwB,MAAM,CAACD,KAAK,CAACL,IAAIM,MAAM;QAC/BN,IAAIM,MAAM,GAAG;IACf;IAEA,iBAAiB;IACjB,IAAIC,MAAMP,IAAIC,MAAM,KAAK,IAAI,IAAIO,MAAM,AAAC,uBAAiC,OAAXR,IAAIC,MAAM,KAAM;IAC9E,IAAID,IAAIM,MAAM,IAAIN,IAAIM,MAAM,CAACG,MAAM,EAAE;QACnCF,MAAMA,OAAO,IAAIC,MAAM;QACvB,IAAK,IAAME,OAAOV,IAAK;YACrB,IAAIrB,UAAUgC,SAAS,CAACC,OAAO,CAACF,OAAO,GAAG;YAC1CH,GAAG,CAACG,IAAI,GAAGG,OAAOC,QAAQ,CAACd,GAAG,CAACU,IAAI,IAAIV,GAAG,CAACU,IAAI,CAACK,QAAQ,CAAC,UAAUf,GAAG,CAACU,IAAI;QAC7E;IACF;IACA,IAAIH,KAAK,MAAMA;IACf,OAAOP;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cross-spawn-cb",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.17",
|
|
4
4
|
"description": "Cross spawn with a completion callback",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-spawn",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "tsds build",
|
|
22
22
|
"deploy": "tsds deploy",
|
|
23
|
-
"format": "biome check --apply src/ test/",
|
|
23
|
+
"format": "biome check --apply-unsafe src/ test/",
|
|
24
24
|
"test": "tsds test:node --timeout=40000",
|
|
25
25
|
"test:engines": "nvu engines tsds test:node --timeout=40000",
|
|
26
26
|
"version": "tsds version"
|
|
@@ -37,16 +37,14 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@biomejs/biome": "^1.5.3",
|
|
39
39
|
"@types/mocha": "^10.0.6",
|
|
40
|
+
"@types/node": "^20.11.17",
|
|
40
41
|
"cr": "^0.1.0",
|
|
41
42
|
"depcheck": "^1.4.7",
|
|
42
43
|
"is-version": "^0.2.1",
|
|
43
|
-
"
|
|
44
|
-
"match-semver": "^0.1.1",
|
|
45
|
-
"mocha-compat": "^3.5.5",
|
|
46
|
-
"node-install-release": "^0.4.7",
|
|
44
|
+
"node-install-release": "^0.4.8",
|
|
47
45
|
"node-resolve-versions": "^0.3.9",
|
|
48
46
|
"node-version-utils": "^0.5.6",
|
|
49
|
-
"ts-dev-stack": "^0.9.
|
|
47
|
+
"ts-dev-stack": "^0.9.6"
|
|
50
48
|
},
|
|
51
49
|
"engines": {
|
|
52
50
|
"node": ">=0.8"
|