File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export abstract class CodacyCli {
3838 public abstract analyze ( options : { file ?: string ; tool ?: string } ) : Promise < ProcessedSarifResult [ ] | null >
3939
4040 public abstract configDiscover ( filePath : string ) : Promise < void >
41-
41+
4242 public getCliCommand ( ) : string {
4343 return this . _cliCommand
4444 }
Original file line number Diff line number Diff line change @@ -23,13 +23,8 @@ export class MacCodacyCli extends CodacyCli {
2323
2424 if ( fs . existsSync ( fullPath ) ) {
2525 this . setCliCommand ( this . _cliVersion ? `CODACY_CLI_V2_VERSION=${ this . _cliVersion } ${ localPath } ` : localPath )
26-
2726 // CLI found, update it if necessary
28- if ( ! this . _cliVersion ) {
29- await this . update ( )
30- }
31-
32- return
27+ return await this . update ( )
3328 }
3429
3530 // CLI not found, attempt to install it
@@ -133,7 +128,10 @@ export class MacCodacyCli extends CodacyCli {
133128 Logger . debug ( 'CLI mode is remote and no identification parameters provided. Skipping update and config reset.' )
134129 return
135130 }
136- await this . execAsync ( updateCommand )
131+ //Call Update if CLI version is not set
132+ if ( ! this . _cliVersion ) {
133+ await this . execAsync ( updateCommand )
134+ }
137135 await this . execAsync ( resetCommand , resetParams )
138136
139137 // Initialize codacy-cli after update
You can’t perform that action at this time.
0 commit comments