export interface ShellCommandResult { readonly exitCode: number; readonly stdout: string; readonly stderr: string; } /** * This is our opinionated wrapper around `child_process` module. It exposes * limited API to call underlying system commands securely with proper Flow * types. It also throws exceptions instead of exiting so you can catch the * failures and react easily (for example call `--abort` when working with Git). */ export declare class ShellCommand { private readonly cwd; constructor(cwd: string, ...command: readonly string[]); private readonly command; private outputToScreen; private throwForNonZeroExit; private stdin?; private environmentVariables?; private maybeThrow; /** * Method `runSynchronously` will return empty string when you set output * to screen. * * @return the same shell command */ setOutputToScreen(): this; setStdin(input: string): this; /** * This method will effectively hide any errors caused by child failure. * Use it sparingly. * * @return the same shell command */ setNoExceptions(): this; setEnvironmentVariables(envs: Map): this; /** * Please note: this function is synchronous which means it should be used for * your dev scripts and not to be executed in production. * * SECURITY NOTE: If the shell option is enabled, do not pass unsanitized user * input to this function. Any input containing shell metacharacters may be * used to trigger arbitrary command execution. * * @return the result of the command * @throws if `setNoExceptions()` has not been called AND the command fails */ runSynchronously(): ShellCommandResult; }