import { exec , ExecOptions } from 'child_process' ; export class ExecError extends Error { constructor ( private readonly error , private readonly stdout , private readonly stderr ) { super ( ) ; } } export function execAsync ( cmd , options ? ) { return new Promise ( ( resolve , reject ) => { exec ( cmd , options , ( error , stdout , stderr ) => { if ( error ) { reject ( new ExecError ( error , stdout , stderr ) ) ; } resolve ( stdout ) ; } ) ; } ) ; }