UNPKG

1.09 kBTypeScriptView Raw
1/// <reference types="node" />
2import * as execa from 'execa';
3import { Writable } from 'stream';
4export { execa };
5export declare function exec(command: string, options?: execa.Options): execa.ExecaChildProcess;
6export declare function exec(commands: string[], options?: execa.Options): Promise<execa.ExecaReturns[]>;
7export declare const spawn: execa.ExecaStatic;
8export declare class ShellContext {
9 private _cwd;
10 private _env;
11 logCommand: boolean;
12 sleep: (ms: number) => Promise<void>;
13 redirectLog?: boolean | string | Writable;
14 cwd(cwd?: string): string;
15 cd(path: string): this;
16 exec(command: string, options?: execa.Options): execa.ExecaChildProcess;
17 exec(commands: string[], options?: execa.Options): Promise<execa.ExecaReturns[]>;
18 spawn(file: string, args?: string[], options?: execa.Options): execa.ExecaChildProcess;
19 env(key: string): string | undefined;
20 env(key: string, val: string | undefined): this;
21 private _getRedirectLogFile;
22}
23export declare function shell(callback: (ctx: ShellContext) => Promise<any>): Promise<any>;