1 |
|
2 | import execa from 'execa';
|
3 | import { WatchDirOptions } from './fs';
|
4 | import { ChildProcess } from 'child_process';
|
5 | export { execa };
|
6 | export declare function exec(command: string, options?: execa.Options): execa.ExecaChildProcess;
|
7 | export declare function exec(commands: string[], options?: execa.Options): Promise<execa.ExecaSyncReturnValue<string>[]>;
|
8 | export declare const spawn: {
|
9 | (file: string, arguments?: readonly string[] | undefined, options?: execa.Options<string> | undefined): execa.ExecaChildProcess<string>;
|
10 | (file: string, arguments?: readonly string[] | undefined, options?: execa.Options<null> | undefined): execa.ExecaChildProcess<Buffer>;
|
11 | (file: string, options?: execa.Options<string> | undefined): execa.ExecaChildProcess<string>;
|
12 | (file: string, options?: execa.Options<null> | undefined): execa.ExecaChildProcess<Buffer>;
|
13 | sync(file: string, arguments?: readonly string[] | undefined, options?: execa.SyncOptions<string> | undefined): execa.ExecaSyncReturnValue<string>;
|
14 | sync(file: string, arguments?: readonly string[] | undefined, options?: execa.SyncOptions<null> | undefined): execa.ExecaSyncReturnValue<Buffer>;
|
15 | sync(file: string, options?: execa.SyncOptions<string> | undefined): execa.ExecaSyncReturnValue<string>;
|
16 | sync(file: string, options?: execa.SyncOptions<null> | undefined): execa.ExecaSyncReturnValue<Buffer>;
|
17 | command(command: string, options?: execa.Options<string> | undefined): execa.ExecaChildProcess<string>;
|
18 | command(command: string, options?: execa.Options<null> | undefined): execa.ExecaChildProcess<Buffer>;
|
19 | commandSync(command: string, options?: execa.SyncOptions<string> | undefined): execa.ExecaSyncReturnValue<string>;
|
20 | commandSync(command: string, options?: execa.SyncOptions<null> | undefined): execa.ExecaSyncReturnValue<Buffer>;
|
21 | node(scriptPath: string, arguments?: readonly string[] | undefined, options?: execa.NodeOptions<string> | undefined): execa.ExecaChildProcess<string>;
|
22 | node(scriptPath: string, arguments?: readonly string[] | undefined, options?: execa.Options<null> | undefined): execa.ExecaChildProcess<Buffer>;
|
23 | node(scriptPath: string, options?: execa.Options<string> | undefined): execa.ExecaChildProcess<string>;
|
24 | node(scriptPath: string, options?: execa.Options<null> | undefined): execa.ExecaChildProcess<Buffer>;
|
25 | };
|
26 | export declare class ShellContext {
|
27 | private _cwdStack;
|
28 | private _env;
|
29 | logCommand: boolean;
|
30 | sleep: (ms: number) => Promise<void>;
|
31 | |
32 |
|
33 |
|
34 | get cwd(): string;
|
35 | protected _logger: import("./logger").Logger;
|
36 | private readonly _process;
|
37 | |
38 |
|
39 |
|
40 |
|
41 | cd(dir: string): this;
|
42 | |
43 |
|
44 |
|
45 |
|
46 | pushd(dir: string): this;
|
47 | |
48 |
|
49 |
|
50 | popd(): this;
|
51 | |
52 |
|
53 |
|
54 |
|
55 |
|
56 | exec(command: string, options?: execa.Options): execa.ExecaChildProcess;
|
57 | exec(commands: string[], options?: execa.Options): Promise<execa.ExecaSyncReturnValue[]>;
|
58 | |
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | spawn(file: string, args?: string[], options?: execa.Options): execa.ExecaChildProcess;
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | env(key: string): string | undefined;
|
73 | env(key: string, val: string | undefined): this;
|
74 | |
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | monitor(dir: string, run: ((p: {
|
87 | current: ChildProcess | null;
|
88 | }) => void) | string | string[], options?: WatchDirOptions & {
|
89 | ignore?: (event: string, file: string) => boolean;
|
90 | }): void;
|
91 | |
92 |
|
93 |
|
94 | resetEnv(): this;
|
95 | private _logCmd;
|
96 | }
|
97 | export declare function shell(callback: (ctx: ShellContext) => Promise<any>): Promise<any>;
|