@zowe/imperative
Version:
framework for building configurable CLIs
26 lines • 1.23 kB
TypeScript
import { SpawnSyncOptions } from "child_process";
/**
* A collection of utilities related to executing a sub-process.
* @export
* @class ExecUtils
*/
export declare class ExecUtils {
/**
* Spawn a process with arguments and throw an error if the process fails.
* Parameters are same as `child_process.spawnSync` (see Node.js docs).
* Use this method if you want the safe argument parsing of `spawnSync`
* combined with the smart output handling of `execSync`.
* @returns Contents of stdout as buffer or string
*/
static spawnAndGetOutput(command: string, args?: string[], options?: SpawnSyncOptions): Buffer | string;
/**
* Spawn a process with arguments and throw an error if the process fails.
* Parameters are same as `child_process.spawnSync` (see Node.js docs).
* Output is inherited by the parent process instead of being returned.
* Use this method if you want the safe argument parsing of `spawnSync`
* combined with the smart output handling of `execSync`.
*/
static spawnWithInheritedStdio(command: string, args?: string[], options?: SpawnSyncOptions): void;
private static handleSpawnResult;
}
//# sourceMappingURL=ExecUtils.d.ts.map