/// import { SpawnOptions } from "child_process"; /** * Standard output and standard error. */ export interface ExecResult { stdout: string; stderr: string; } /** * Error thrown when a command cannot be executed, the command is * killed, or returns a non-zero exit status. */ export declare class ExecError extends Error { message: string; cmd: string; code: number; signal: string; stdout: string; stderr: string; constructor(message: string, cmd: string, code: number, signal: string, stdout: string, stderr: string); } /** * Run a child process using cross-spawn, capturing and returning * stdout and stderr, like exec, in a promise. If an error occurs, * the process is killed by a signal, or the process exits with a * non-zero status, the Promise is rejected. stdin is inherited from * the parent process. Like with child_process.exec, this is not a * good choice if the command produces a large amount of data on * stdout or stderr. * * @param {string} cmd name of command, can be a shell script or MS Windows .bat or .cmd * @param {string[]} args command arguments * @param {"child_process".SpawnOptions} opts standard spawn options * @return {Promise} exec-like callback arguments having stdout and stderr properties */ export declare function safeExec(cmd: string, args?: string[], opts?: SpawnOptions): Promise; /** * Safely exec a command in a specific directory. * * @param baseDir directory to run command in * @param cmd command to run * @param args command arguments * @return Promise of { stdout, stderr } */ export declare function execIn(baseDir: string, cmd: string, args: string[]): Promise;