@@ -7,10 +7,12 @@ export interface IProcessArgument {
77 sanitise : boolean ;
88}
99
10- export function exec ( bin : string , ...processArgs : IProcessArgument [ ] ) :
11- Promise < SpawnPromiseResult > {
10+ export function exec (
11+ bin : string ,
12+ ...processArgs : IProcessArgument [ ]
13+ ) : Promise < SpawnPromiseResult > {
1214 if ( process . env . DEBUG === 'true' ) {
13- processArgs . push ( { body : '--debug' , sanitise : false } ) ;
15+ processArgs . push ( { body : '--debug' , sanitise : false } ) ;
1416 }
1517
1618 // Ensure we're not passing the whole environment to the shelled out process...
@@ -24,11 +26,14 @@ export function exec(bin: string, ...processArgs: IProcessArgument[]):
2426 } ;
2527
2628 const allArguments = processArgs . map ( ( arg ) => arg . body ) ;
27- return spawn ( bin , allArguments , { env, capture : [ 'stdout' , 'stderr' ] } )
28- . catch ( ( error ) => {
29+ return spawn ( bin , allArguments , { env, capture : [ 'stdout' , 'stderr' ] } ) . catch (
30+ ( error ) => {
2931 const message = ( error && error . stderr ) || 'Unknown reason' ;
30- const loggableArguments = processArgs . filter ( ( arg ) => ! arg . sanitise ) . map ( ( arg ) => arg . body ) ;
31- logger . warn ( { message, bin, loggableArguments} , 'child process failure' ) ;
32+ const loggableArguments = processArgs
33+ . filter ( ( arg ) => ! arg . sanitise )
34+ . map ( ( arg ) => arg . body ) ;
35+ logger . warn ( { message, bin, loggableArguments } , 'child process failure' ) ;
3236 throw error ;
33- } ) ;
37+ } ,
38+ ) ;
3439}
0 commit comments