format import { ExecError , FlipperServerCommands } from 'flipper-common' ; import { exec } from 'child_process' ; import assert from 'assert' ; export const commandNodeApiExec = async ( command , options ) => new Promise ( ( resolve , reject ) => exec ( command , options , ( error , stdout , stderr ) => { assert ( typeof stdout === 'string' ) ; assert ( typeof stderr === 'string' ) ; if ( error ) { const wrappedError = { message : error . message , stdout , stderr , cmd : error . cmd , killed : error . killed , code : error . code , stack : error . stack , } ; reject ( wrappedError ) ; return ; } resolve ( { stdout , stderr , } ) ; } ) ) ;