@@ -637,9 +637,10 @@ export class CodeQLCliServer implements Disposable {
637637 } = { } ,
638638 ) : Promise < OutputType > {
639639 let args : string [ ] = [ ] ;
640- if ( addFormat )
640+ if ( addFormat ) {
641641 // Add format argument first, in case commandArgs contains positional parameters.
642642 args = args . concat ( [ "--format" , "json" ] ) ;
643+ }
643644 args = args . concat ( commandArgs ) ;
644645 const result = await this . runCodeQlCliCommand ( command , args , description , {
645646 progressReporter,
@@ -941,8 +942,12 @@ export class CodeQLCliServer implements Disposable {
941942 name ?: string ,
942943 ) : Promise < string > {
943944 const subcommandArgs = [ ] ;
944- if ( target ) subcommandArgs . push ( "--target" , target ) ;
945- if ( name ) subcommandArgs . push ( "--name" , name ) ;
945+ if ( target ) {
946+ subcommandArgs . push ( "--target" , target ) ;
947+ }
948+ if ( name ) {
949+ subcommandArgs . push ( "--name" , name ) ;
950+ }
946951 subcommandArgs . push ( archivePath ) ;
947952
948953 return await this . runCodeQlCliCommand (
@@ -963,7 +968,9 @@ export class CodeQLCliServer implements Disposable {
963968 outputDirectory ?: string ,
964969 ) : Promise < string > {
965970 const subcommandArgs = [ "--format=markdown" ] ;
966- if ( outputDirectory ) subcommandArgs . push ( "--output" , outputDirectory ) ;
971+ if ( outputDirectory ) {
972+ subcommandArgs . push ( "--output" , outputDirectory ) ;
973+ }
967974 subcommandArgs . push ( pathToQhelp ) ;
968975
969976 return await this . runCodeQlCliCommand (
@@ -1611,16 +1618,19 @@ export function spawnServer(
16111618 } ) ;
16121619 // Set up event listeners.
16131620 child . on ( "close" , async ( code , signal ) => {
1614- if ( code !== null )
1621+ if ( code !== null ) {
16151622 void logger . log ( `Child process exited with code ${ code } ` ) ;
1616- if ( signal )
1623+ }
1624+ if ( signal ) {
16171625 void logger . log (
16181626 `Child process exited due to receipt of signal ${ signal } ` ,
16191627 ) ;
1628+ }
16201629 // If the process exited abnormally, log the last stdout message,
16211630 // It may be from the jvm.
1622- if ( code !== 0 && lastStdout !== undefined )
1631+ if ( code !== 0 && lastStdout !== undefined ) {
16231632 void logger . log ( `Last stdout was "${ lastStdout . toString ( ) } "` ) ;
1633+ }
16241634 } ) ;
16251635 child . stderr ! . on ( "data" , stderrListener ) ;
16261636 if ( stdoutListener !== undefined ) {
0 commit comments