@idlebox/node 1.1.1 → 1.2.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/docs/package-public.d.ts +2 -2
- package/lib/child_process/execa.cjs +6 -7
- package/lib/child_process/execa.cjs.map +1 -1
- package/lib/child_process/execa.js +3 -3
- package/lib/child_process/execa.js.map +1 -1
- package/lib/child_process/lateError.cjs +2 -3
- package/lib/child_process/lateError.cjs.map +1 -1
- package/lib/child_process/lateError.js +1 -1
- package/lib/child_process/lateError.js.map +1 -1
- package/package.json +12 -12
- package/src/child_process/execa.ts +7 -7
- package/src/child_process/lateError.ts +2 -3
- package/config/rush-project.json +0 -3
package/docs/package-public.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
|
-
import execa from 'execa';
|
|
5
4
|
import { ExecaReturnValue } from 'execa';
|
|
6
5
|
import { IDisposable } from '@idlebox/common';
|
|
6
|
+
import { Options } from 'execa';
|
|
7
7
|
import { PathArray } from '@idlebox/common';
|
|
8
8
|
import { Readable } from 'stream';
|
|
9
9
|
import { Transform } from 'stream';
|
|
@@ -184,7 +184,7 @@ export declare enum ERRNO_LINUX {
|
|
|
184
184
|
EOVERFLOW = 139
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
export declare function execLazyError(cmd: string, args: string[], spawnOptions?: Omit<
|
|
187
|
+
export declare function execLazyError(cmd: string, args: string[], spawnOptions?: Omit<Options, 'reject' | 'stdio' | 'encoding' | 'all' | 'stderr'> & ISpawnAdditionOptions): Promise<ExecaReturnValue<string>>;
|
|
188
188
|
|
|
189
189
|
export declare function exists(path: string): Promise<boolean>;
|
|
190
190
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.spawnGetEverything = exports.spawnGetOutput = exports.spawnWithoutOutput = void 0;
|
|
4
|
-
const
|
|
5
|
-
const execa_1 = (0, tslib_1.__importDefault)(require("execa"));
|
|
4
|
+
const execa_1 = require("execa");
|
|
6
5
|
const error_cjs_1 = require("./error.cjs");
|
|
7
6
|
function handleError(result) {
|
|
8
7
|
if (result.exitCode !== 0) {
|
|
@@ -21,10 +20,10 @@ function spawnWithoutOutput({ exec, cwd, sync }) {
|
|
|
21
20
|
reject: false,
|
|
22
21
|
};
|
|
23
22
|
if (sync) {
|
|
24
|
-
(0, error_cjs_1.checkChildProcessResult)(execa_1.
|
|
23
|
+
(0, error_cjs_1.checkChildProcessResult)((0, execa_1.execaSync)(cmd, args, opts));
|
|
25
24
|
}
|
|
26
25
|
else {
|
|
27
|
-
return (0, execa_1.
|
|
26
|
+
return (0, execa_1.execa)(cmd, args, opts)
|
|
28
27
|
.then(error_cjs_1.checkChildProcessResult)
|
|
29
28
|
.then(() => {
|
|
30
29
|
return;
|
|
@@ -42,11 +41,11 @@ function spawnGetOutput({ exec, cwd, sync }) {
|
|
|
42
41
|
encoding: 'utf8',
|
|
43
42
|
};
|
|
44
43
|
if (sync) {
|
|
45
|
-
const result = handleError(execa_1.
|
|
44
|
+
const result = handleError((0, execa_1.execaSync)(cmd, args, opts));
|
|
46
45
|
return result.stdout;
|
|
47
46
|
}
|
|
48
47
|
else {
|
|
49
|
-
return (0, execa_1.
|
|
48
|
+
return (0, execa_1.execa)(cmd, args, opts)
|
|
50
49
|
.then(handleError)
|
|
51
50
|
.then((result) => {
|
|
52
51
|
return result.stdout;
|
|
@@ -64,7 +63,7 @@ function spawnGetEverything({ exec, cwd }) {
|
|
|
64
63
|
encoding: 'utf8',
|
|
65
64
|
all: true,
|
|
66
65
|
};
|
|
67
|
-
return (0, execa_1.
|
|
66
|
+
return (0, execa_1.execa)(cmd, args, opts)
|
|
68
67
|
.then(handleError)
|
|
69
68
|
.then((result) => {
|
|
70
69
|
return result.all;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execa.js","sourceRoot":"","sources":["../../src/child_process/execa.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execa.js","sourceRoot":"","sources":["../../src/child_process/execa.ts"],"names":[],"mappings":";;;AAAA,iCAAuE;AACvE,2CAAkD;AAclD,SAAS,WAAW,CAAoC,MAAS;IAChE,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;KAC7D;SAAM,IAAI,MAAM,CAAC,MAAM,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;KAC7D;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAID,SAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAoB;IACvE,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5B,MAAM,IAAI,GAAgB;QACzB,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;QACjD,GAAG;QACH,MAAM,EAAE,KAAK;KACb,CAAC;IAEF,IAAI,IAAI,EAAE;QACT,IAAA,mCAAuB,EAAC,IAAA,iBAAS,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;KACpD;SAAM;QACN,OAAO,IAAA,aAAK,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;aAC3B,IAAI,CAAC,mCAAuB,CAAC;aAC7B,IAAI,CAAC,GAAG,EAAE;YACV,OAAO;QACR,CAAC,CAAC,CAAC;KACJ;AACF,CAAC;AAjBD,gDAiBC;AAID,SAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAY;IAC3D,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,G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
1
|
+
import { execa, execaSync } from 'execa';
|
|
2
2
|
import { checkChildProcessResult } from "./error.js";
|
|
3
3
|
function handleError(result) {
|
|
4
4
|
if (result.exitCode !== 0) {
|
|
@@ -17,7 +17,7 @@ export function spawnWithoutOutput({ exec, cwd, sync }) {
|
|
|
17
17
|
reject: false,
|
|
18
18
|
};
|
|
19
19
|
if (sync) {
|
|
20
|
-
checkChildProcessResult(
|
|
20
|
+
checkChildProcessResult(execaSync(cmd, args, opts));
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
23
|
return execa(cmd, args, opts)
|
|
@@ -37,7 +37,7 @@ export function spawnGetOutput({ exec, cwd, sync }) {
|
|
|
37
37
|
encoding: 'utf8',
|
|
38
38
|
};
|
|
39
39
|
if (sync) {
|
|
40
|
-
const result = handleError(
|
|
40
|
+
const result = handleError(execaSync(cmd, args, opts));
|
|
41
41
|
return result.stdout;
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execa.js","sourceRoot":"","sources":["../../src/child_process/execa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"execa.js","sourceRoot":"","sources":["../../src/child_process/execa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAmB,SAAS,EAAe,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,mBAAgB;AAclD,SAAS,WAAW,CAAoC,MAAS;IAChE,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;KAC7D;SAAM,IAAI,MAAM,CAAC,MAAM,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;KAC7D;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAID,MAAM,UAA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,MAAM,CAAC;QACtB,CAAC,CAAC,CAAC;KACJ;AACF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAY;IACzD,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5B,MAAM,IAAI,GAAgB;QACzB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;QACjC,GAAG;QACH,MAAM,EAAE,KAAK;QACb,iBAAiB,EAAE,IAAI;QACvB,QAAQ,EAAE,MAAM;QAChB,GAAG,EAAE,IAAI;KACT,CAAC;IAEF,OAAO,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;SAC3B,IAAI,CAAC,WAAW,CAAC;SACjB,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QAChB,OAAO,MAAM,CAAC,GAAG,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.execLazyError = void 0;
|
|
4
|
-
const
|
|
5
|
-
const execa_1 = (0, tslib_1.__importDefault)(require("execa"));
|
|
4
|
+
const execa_1 = require("execa");
|
|
6
5
|
const output_cjs_1 = require("../cli-io/output.cjs");
|
|
7
6
|
const error_cjs_1 = require("./error.cjs");
|
|
8
7
|
async function execLazyError(cmd, args, spawnOptions = {}) {
|
|
@@ -20,7 +19,7 @@ async function execLazyError(cmd, args, spawnOptions = {}) {
|
|
|
20
19
|
process.stderr.write(`${cmd} ${args.join(' ')}\n`);
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
|
-
const p = (0, execa_1.
|
|
22
|
+
const p = (0, execa_1.execa)(cmd, args, {
|
|
24
23
|
...options,
|
|
25
24
|
stdio: [stdin || 'ignore', stdout, 'pipe'],
|
|
26
25
|
all: all,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lateError.js","sourceRoot":"","sources":["../../src/child_process/lateError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lateError.js","sourceRoot":"","sources":["../../src/child_process/lateError.ts"],"names":[],"mappings":";;;AAAA,iCAAyE;AACzE,qDAA6C;AAC7C,2CAAkD;AAM3C,KAAK,UAAU,aAAa,CAClC,GAAW,EACX,IAAc,EACd,eAA+G,EAAE;IAEjH,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,YAAY,CAAC;IAE1D,IAAI,MAAM,KAAK,SAAS,EAAE;QACzB,GAAG,GAAG,IAAI,CAAC;QACX,MAAM,GAAG,MAAM,CAAC;KAChB;IAED,IAAI,OAAO,EAAE;QACZ,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE;YACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;SACjE;aAAM;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACnD;KACD;IAED,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,GAAG,EAAE,IAAI,EAAE;QAC1B,GAAG,OAAO;QACV,KAAK,EAAE,CAAC,KAAK,IAAI,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;QAC1C,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,KAAK;KACb,CAAC,CAAC;IACH,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;QACrB,IAAI;YACH,IAAA,mCAAuB,EAAC,GAAG,CAAC,CAAC;SAC7B;QAAC,OAAO,CAAC,EAAE;YACX,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE;gBACzB,IAAA,sBAAS,GAAE,CAAC;gBACZ,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;aAC9D;YACD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;YACrC,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE;gBACzB,IAAA,sBAAS,GAAE,CAAC;aACZ;YACD,MAAM,CAAC,CAAC;SACR;QACD,OAAO,GAAG,CAAC;IACZ,CAAC,CAAC,CAAC;AACJ,CAAC;AA5CD,sCA4CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lateError.js","sourceRoot":"","sources":["../../src/child_process/lateError.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"lateError.js","sourceRoot":"","sources":["../../src/child_process/lateError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA6C,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,4BAAyB;AAC7C,OAAO,EAAE,uBAAuB,EAAE,mBAAgB;AAMlD,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,GAAW,EACX,IAAc,EACd,eAA+G,EAAE;IAEjH,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,YAAY,CAAC;IAE1D,IAAI,MAAM,KAAK,SAAS,EAAE;QACzB,GAAG,GAAG,IAAI,CAAC;QACX,MAAM,GAAG,MAAM,CAAC;KAChB;IAED,IAAI,OAAO,EAAE;QACZ,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE;YACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;SACjE;aAAM;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACnD;KACD;IAED,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE;QAC1B,GAAG,OAAO;QACV,KAAK,EAAE,CAAC,KAAK,IAAI,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;QAC1C,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,KAAK;KACb,CAAC,CAAC;IACH,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;QACrB,IAAI;YACH,uBAAuB,CAAC,GAAG,CAAC,CAAC;SAC7B;QAAC,OAAO,CAAC,EAAE;YACX,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE;gBACzB,SAAS,EAAE,CAAC;gBACZ,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;aAC9D;YACD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;YACrC,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE;gBACzB,SAAS,EAAE,CAAC;aACZ;YACD,MAAM,CAAC,CAAC;SACR;QACD,OAAO,GAAG,CAAC;IACZ,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"monorepo": "rush",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"name": "@idlebox/node",
|
|
6
6
|
"type": "module",
|
|
@@ -20,24 +20,24 @@
|
|
|
20
20
|
"watch": "build-script watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@idlebox/common": "^1.
|
|
24
|
-
"execa": "^
|
|
25
|
-
"source-map-support": "^0.5.
|
|
23
|
+
"@idlebox/common": "^1.3.3",
|
|
24
|
+
"execa": "^6.1.0",
|
|
25
|
+
"source-map-support": "^0.5.21",
|
|
26
26
|
"tslib": "^2.3.1"
|
|
27
27
|
},
|
|
28
28
|
"optionalDependencies": {
|
|
29
29
|
"kexec": "github:meteor/node-kexec#update-for-node-12"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@build-script/builder": "^3.
|
|
33
|
-
"@build-script/export-all-in-one": "^3.0
|
|
34
|
-
"@build-script/single-dog-asset": "^1.0.
|
|
35
|
-
"@build-script/typescript-transformer-dual-package": "^1.0.
|
|
36
|
-
"@types/node": "^
|
|
32
|
+
"@build-script/builder": "^3.2.2",
|
|
33
|
+
"@build-script/export-all-in-one": "^3.1.0",
|
|
34
|
+
"@build-script/single-dog-asset": "^1.0.15",
|
|
35
|
+
"@build-script/typescript-transformer-dual-package": "^1.0.24",
|
|
36
|
+
"@types/node": "^17.0.21",
|
|
37
37
|
"gulp": "^4.0.2",
|
|
38
|
-
"ttypescript": "^1.5.
|
|
39
|
-
"typescript": "^4.
|
|
40
|
-
"
|
|
38
|
+
"ttypescript": "^1.5.13",
|
|
39
|
+
"typescript": "^4.6.2",
|
|
40
|
+
"esm": "^3.2.25"
|
|
41
41
|
},
|
|
42
42
|
"repository": "https://github.com/GongT/baobao"
|
|
43
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import execa from 'execa';
|
|
1
|
+
import { execa, ExecaReturnBase, execaSync, SyncOptions } from 'execa';
|
|
2
2
|
import { checkChildProcessResult } from './error';
|
|
3
3
|
|
|
4
4
|
export interface Sync {
|
|
@@ -13,7 +13,7 @@ export interface ICommand {
|
|
|
13
13
|
sync?: boolean;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function handleError<T extends
|
|
16
|
+
function handleError<T extends ExecaReturnBase<string>>(result: T): T {
|
|
17
17
|
if (result.exitCode !== 0) {
|
|
18
18
|
throw new Error('command exit with code ' + result.exitCode);
|
|
19
19
|
} else if (result.signal) {
|
|
@@ -26,14 +26,14 @@ export function spawnWithoutOutput(opt: ICommand & Sync): void;
|
|
|
26
26
|
export function spawnWithoutOutput(opt: ICommand & Async): Promise<void>;
|
|
27
27
|
export function spawnWithoutOutput({ exec, cwd, sync }: ICommand & Async): void | Promise<void> {
|
|
28
28
|
const [cmd, ...args] = exec;
|
|
29
|
-
const opts:
|
|
29
|
+
const opts: SyncOptions = {
|
|
30
30
|
stdio: ['ignore', process.stderr, process.stderr],
|
|
31
31
|
cwd,
|
|
32
32
|
reject: false,
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
if (sync) {
|
|
36
|
-
checkChildProcessResult(
|
|
36
|
+
checkChildProcessResult(execaSync(cmd, args, opts));
|
|
37
37
|
} else {
|
|
38
38
|
return execa(cmd, args, opts)
|
|
39
39
|
.then(checkChildProcessResult)
|
|
@@ -47,7 +47,7 @@ export function spawnGetOutput(opt: ICommand & Sync): string;
|
|
|
47
47
|
export function spawnGetOutput(opt: ICommand & Async): Promise<string>;
|
|
48
48
|
export function spawnGetOutput({ exec, cwd, sync }: ICommand) {
|
|
49
49
|
const [cmd, ...args] = exec;
|
|
50
|
-
const opts:
|
|
50
|
+
const opts: SyncOptions = {
|
|
51
51
|
stdio: ['ignore', 'pipe', process.stderr],
|
|
52
52
|
cwd,
|
|
53
53
|
reject: false,
|
|
@@ -56,7 +56,7 @@ export function spawnGetOutput({ exec, cwd, sync }: ICommand) {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
if (sync) {
|
|
59
|
-
const result = handleError(
|
|
59
|
+
const result = handleError(execaSync(cmd, args, opts));
|
|
60
60
|
return result.stdout;
|
|
61
61
|
} else {
|
|
62
62
|
return execa(cmd, args, opts)
|
|
@@ -69,7 +69,7 @@ export function spawnGetOutput({ exec, cwd, sync }: ICommand) {
|
|
|
69
69
|
|
|
70
70
|
export function spawnGetEverything({ exec, cwd }: ICommand) {
|
|
71
71
|
const [cmd, ...args] = exec;
|
|
72
|
-
const opts:
|
|
72
|
+
const opts: SyncOptions = {
|
|
73
73
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
74
74
|
cwd,
|
|
75
75
|
reject: false,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import execa,
|
|
2
|
-
|
|
1
|
+
import { execa, ExecaReturnValue, Options as ExecaOptions } from 'execa';
|
|
3
2
|
import { printLine } from '../cli-io/output';
|
|
4
3
|
import { checkChildProcessResult } from './error';
|
|
5
4
|
|
|
@@ -10,7 +9,7 @@ export interface ISpawnAdditionOptions {
|
|
|
10
9
|
export async function execLazyError(
|
|
11
10
|
cmd: string,
|
|
12
11
|
args: string[],
|
|
13
|
-
spawnOptions: Omit<
|
|
12
|
+
spawnOptions: Omit<ExecaOptions, 'reject' | 'stdio' | 'encoding' | 'all' | 'stderr'> & ISpawnAdditionOptions = {}
|
|
14
13
|
): Promise<ExecaReturnValue<string>> {
|
|
15
14
|
let all = false;
|
|
16
15
|
let { stdout, stdin, verbose, ...options } = spawnOptions;
|
package/config/rush-project.json
DELETED