spawn-rx 5.0.2 → 5.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/src/index.js +11 -9
- package/lib/src/index.js.map +1 -1
- package/package.json +1 -2
- package/src/index.ts +16 -10
package/lib/src/index.js
CHANGED
@@ -40,7 +40,6 @@ exports.spawnPromise = spawnPromise;
|
|
40
40
|
var path = require("path");
|
41
41
|
var net = require("net");
|
42
42
|
var sfs = require("fs");
|
43
|
-
var assign = require("lodash.assign");
|
44
43
|
var rxjs_1 = require("rxjs");
|
45
44
|
var operators_1 = require("rxjs/operators");
|
46
45
|
var child_process_1 = require("child_process");
|
@@ -175,11 +174,14 @@ function findActualExecutable(exe, args) {
|
|
175
174
|
function spawnDetached(exe, params, opts) {
|
176
175
|
var _a = findActualExecutable(exe, params !== null && params !== void 0 ? params : []), cmd = _a.cmd, args = _a.args;
|
177
176
|
if (!isWindows) {
|
178
|
-
return spawn(cmd, args, assign({}, opts || {}, { detached: true }));
|
177
|
+
return spawn(cmd, args, Object.assign({}, opts || {}, { detached: true }));
|
179
178
|
}
|
180
179
|
var newParams = [cmd].concat(args);
|
181
180
|
var target = path.join(__dirname, "..", "..", "vendor", "jobber", "Jobber.exe");
|
182
|
-
var options = assign({}, opts || {}, {
|
181
|
+
var options = Object.assign({}, opts || {}, {
|
182
|
+
detached: true,
|
183
|
+
jobber: true,
|
184
|
+
});
|
183
185
|
d("spawnDetached: ".concat(target, ", ").concat(newParams));
|
184
186
|
return spawn(target, newParams, options);
|
185
187
|
}
|
@@ -323,14 +325,14 @@ function wrapObservableInSplitPromise(obs) {
|
|
323
325
|
obs.subscribe({
|
324
326
|
next: function (x) { return (x.source === "stdout" ? (out += x.text) : (err += x.text)); },
|
325
327
|
error: function (e) {
|
326
|
-
var
|
328
|
+
var error = new Error("".concat(out, "\n").concat(e.message));
|
327
329
|
if ("exitCode" in e) {
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
330
|
+
error.exitCode = e.exitCode;
|
331
|
+
error.code = e.exitCode;
|
332
|
+
error.stdout = out;
|
333
|
+
error.stderr = err;
|
332
334
|
}
|
333
|
-
rej(
|
335
|
+
rej(error);
|
334
336
|
},
|
335
337
|
complete: function () { return res([out, err]); },
|
336
338
|
});
|
package/lib/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,oDA8DC;AA6ED,sCAgCC;AA2DD,sBAgIC;AAkGD,oDAcC;AAqDD,oCAcC;AA7mBD,uDAAuD;AACvD,2BAA6B;AAC7B,yBAA2B;AAC3B,wBAA0B;AAG1B,6BAAyE;AACzE,4CAA6C;AAC7C,+CAA+D;AAC/D,+BAA0B;AAE1B,IAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAE/C,IAAM,CAAC,GAAG,IAAA,eAAK,EAAC,UAAU,CAAC,CAAC,CAAC,sCAAsC;AAEnE;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,IAAY;IACvC,IAAI,CAAC;QACH,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,WAAW,CAAC,GAAW;IAC9B,sEAAsE;IACtE,aAAa;IAEb,uDAAuD;IACvD,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,CAAC,CAAC,sCAAsC,CAAC,CAAC;QAC1C,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC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AEnC,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAAE,CAAC;QAChB,OAAO,4BAA4B,CACjC,aAAa,CAAC,GAAG,EAAE,MAAM,wBAAO,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,KAAE,KAAK,EAAE,IAAI,IAAG,CAC7D,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,uBAAuB,CAC5B,aAAa,CAAC,GAAG,EAAE,MAAM,wBAAO,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,KAAE,KAAK,EAAE,KAAK,IAAG,CAC9D,CAAC;IACJ,CAAC;AACH,CAAC;AAwCD;;;;;;;;;;;;GAYG;AACH,SAAgB,YAAY,CAC1B,GAAW,EACX,MAAgB,EAChB,IAAmC;IAEnC,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAAE,CAAC;QAChB,OAAO,4BAA4B,CACjC,KAAK,CAAC,GAAG,EAAE,MAAM,wBAAO,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,KAAE,KAAK,EAAE,IAAI,IAAG,CACrD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,uBAAuB,CAC5B,KAAK,CAAC,GAAG,EAAE,MAAM,wBAAO,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,KAAE,KAAK,EAAE,KAAK,IAAG,CACtD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "spawn-rx",
|
3
|
-
"version": "5.0.
|
3
|
+
"version": "5.0.4",
|
4
4
|
"description": "An Rx-version of child_process.spawn",
|
5
5
|
"scripts": {
|
6
6
|
"doc": "echo \"esdoc may not work correctly\" && esdoc -c ./esdoc.json",
|
@@ -28,7 +28,6 @@
|
|
28
28
|
"homepage": "https://github.com/anaisbetts/spawn-rx",
|
29
29
|
"dependencies": {
|
30
30
|
"debug": "^4.3.7",
|
31
|
-
"lodash.assign": "^4.2.0",
|
32
31
|
"rxjs": "^7.8.1"
|
33
32
|
},
|
34
33
|
"devDependencies": {
|
package/src/index.ts
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
import * as path from "path";
|
3
3
|
import * as net from "net";
|
4
4
|
import * as sfs from "fs";
|
5
|
-
import * as assign from "lodash.assign";
|
6
5
|
|
7
6
|
import type { Observer, Subject } from "rxjs";
|
8
7
|
import { Observable, Subscription, AsyncSubject, of, merge } from "rxjs";
|
@@ -230,7 +229,11 @@ export function spawnDetached(
|
|
230
229
|
const { cmd, args } = findActualExecutable(exe, params ?? []);
|
231
230
|
|
232
231
|
if (!isWindows) {
|
233
|
-
return spawn(
|
232
|
+
return spawn(
|
233
|
+
cmd,
|
234
|
+
args,
|
235
|
+
Object.assign({}, opts || {}, { detached: true }) as any,
|
236
|
+
);
|
234
237
|
}
|
235
238
|
|
236
239
|
const newParams = [cmd].concat(args);
|
@@ -243,10 +246,13 @@ export function spawnDetached(
|
|
243
246
|
"jobber",
|
244
247
|
"Jobber.exe",
|
245
248
|
);
|
246
|
-
const options = assign({}, opts || {}, {
|
249
|
+
const options = Object.assign({}, opts || {}, {
|
250
|
+
detached: true,
|
251
|
+
jobber: true,
|
252
|
+
});
|
247
253
|
|
248
254
|
d(`spawnDetached: ${target}, ${newParams}`);
|
249
|
-
return spawn(target, newParams, options);
|
255
|
+
return spawn(target, newParams, options as any);
|
250
256
|
}
|
251
257
|
|
252
258
|
/**
|
@@ -463,15 +469,15 @@ function wrapObservableInSplitPromise(obs: Observable<OutputLine>) {
|
|
463
469
|
obs.subscribe({
|
464
470
|
next: (x) => (x.source === "stdout" ? (out += x.text) : (err += x.text)),
|
465
471
|
error: (e) => {
|
466
|
-
const
|
472
|
+
const error: any = new Error(`${out}\n${e.message}`);
|
467
473
|
|
468
474
|
if ("exitCode" in e) {
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
475
|
+
error.exitCode = e.exitCode;
|
476
|
+
error.code = e.exitCode;
|
477
|
+
error.stdout = out;
|
478
|
+
error.stderr = err;
|
473
479
|
}
|
474
|
-
rej(
|
480
|
+
rej(error);
|
475
481
|
},
|
476
482
|
complete: () => res([out, err]),
|
477
483
|
});
|