@@ -20,7 +20,7 @@ export class CxInstaller {
2020 this . resourceDirPath = path . join ( __dirname , `../wrapper/resources` ) ;
2121 }
2222
23- async getDownloadURL ( ) : Promise < string > {
23+ private async getDownloadURL ( ) : Promise < string > {
2424 const cliVersion = await this . readASTCLIVersion ( ) ;
2525
2626 const platforms : Record < SupportedPlatforms , { platform : string ; extension : string } > = {
@@ -39,13 +39,13 @@ export class CxInstaller {
3939 return `https://download.checkmarx.com/CxOne/CLI/${ cliVersion } /ast-cli_${ cliVersion } _${ platformData . platform } _x64.${ platformData . extension } ` ;
4040 }
4141
42- getExecutablePath ( ) : string {
42+ public getExecutablePath ( ) : string {
4343 const executableName = this . platform === 'win32' ? 'cx.exe' : 'cx' ;
4444 return path . join ( this . resourceDirPath , executableName ) ;
4545 }
4646
4747
48- async downloadIfNotInstalledCLI ( ) : Promise < void > {
48+ public async downloadIfNotInstalledCLI ( ) : Promise < void > {
4949 try {
5050 await fs . promises . mkdir ( this . resourceDirPath , { recursive : true } ) ;
5151
@@ -76,7 +76,7 @@ export class CxInstaller {
7676 }
7777 }
7878
79- async extractArchive ( zipPath : string , extractPath : string ) : Promise < void > {
79+ private async extractArchive ( zipPath : string , extractPath : string ) : Promise < void > {
8080 if ( zipPath . endsWith ( '.zip' ) ) {
8181 await unzipper . Open . file ( zipPath )
8282 . then ( d => d . extract ( { path : extractPath } ) ) ;
@@ -87,7 +87,7 @@ export class CxInstaller {
8787 }
8888 }
8989
90- async downloadFile ( url : string , outputPath : string ) {
90+ private async downloadFile ( url : string , outputPath : string ) {
9191 logger . info ( 'Downloading file from:' , url ) ;
9292 const writer = fs . createWriteStream ( outputPath ) ;
9393 const response = await axios ( { url, responseType : 'stream' } ) ;
@@ -97,11 +97,11 @@ export class CxInstaller {
9797 logger . info ( 'Download finished' ) ;
9898 }
9999
100- checkExecutableExists ( ) : boolean {
100+ private checkExecutableExists ( ) : boolean {
101101 return fs . existsSync ( this . getExecutablePath ( ) ) ;
102102 }
103103
104- async readASTCLIVersion ( ) : Promise < string > {
104+ private async readASTCLIVersion ( ) : Promise < string > {
105105 if ( this . cliVersion ) {
106106 return this . cliVersion ;
107107 }
@@ -114,8 +114,8 @@ export class CxInstaller {
114114 return this . cliDefaultVersion ;
115115 }
116116 }
117-
118- getCompressFolderName ( ) : string {
117+
118+ private getCompressFolderName ( ) : string {
119119 return `ast-cli.${ this . platform === 'win32' ? 'zip' : 'tar.gz' } ` ;
120120 }
121121}
0 commit comments