UNPKG

1.23 kBTypeScriptView Raw
1/// <reference types="node" />
2import { ChildProcess } from 'child_process';
3import { ILogger, IShell, IShellOutputOptions, IShellRunOptions, IShellSpawnOptions } from '../definitions';
4export interface ShellDeps {
5 readonly log: ILogger;
6}
7export interface ShellOptions {
8 readonly alterPath?: (p: string) => string;
9}
10export declare class Shell implements IShell {
11 protected readonly e: ShellDeps;
12 readonly alterPath: (p: string) => string;
13 constructor(e: ShellDeps, options?: ShellOptions);
14 run(command: string, args: string[], { stream, killOnExit, showCommand, showError, fatalOnNotFound, fatalOnError, truncateErrorOutput, ...crossSpawnOptions }: IShellRunOptions): Promise<void>;
15 output(command: string, args: string[], { fatalOnNotFound, fatalOnError, showError, showCommand, ...crossSpawnOptions }: IShellOutputOptions): Promise<string>;
16 spawn(command: string, args: string[], { showCommand, ...crossSpawnOptions }: IShellSpawnOptions): ChildProcess;
17 cmdinfo(command: string, args?: string[]): Promise<string | undefined>;
18 protected prepareSpawnOptions(options: IShellSpawnOptions): void;
19}
20export declare function prependNodeModulesBinToPath(projectDir: string, p: string): string;