@@ -20,7 +20,7 @@ export class CxInstaller {
20
20
this . resourceDirPath = path . join ( __dirname , `../wrapper/resources` ) ;
21
21
}
22
22
23
- async getDownloadURL ( ) : Promise < string > {
23
+ private async getDownloadURL ( ) : Promise < string > {
24
24
const cliVersion = await this . readASTCLIVersion ( ) ;
25
25
26
26
const platforms : Record < SupportedPlatforms , { platform : string ; extension : string } > = {
@@ -39,13 +39,13 @@ export class CxInstaller {
39
39
return `https://download.checkmarx.com/CxOne/CLI/${ cliVersion } /ast-cli_${ cliVersion } _${ platformData . platform } _x64.${ platformData . extension } ` ;
40
40
}
41
41
42
- getExecutablePath ( ) : string {
42
+ public getExecutablePath ( ) : string {
43
43
const executableName = this . platform === 'win32' ? 'cx.exe' : 'cx' ;
44
44
return path . join ( this . resourceDirPath , executableName ) ;
45
45
}
46
46
47
47
48
- async downloadIfNotInstalledCLI ( ) : Promise < void > {
48
+ public async downloadIfNotInstalledCLI ( ) : Promise < void > {
49
49
try {
50
50
await fs . promises . mkdir ( this . resourceDirPath , { recursive : true } ) ;
51
51
@@ -76,7 +76,7 @@ export class CxInstaller {
76
76
}
77
77
}
78
78
79
- async extractArchive ( zipPath : string , extractPath : string ) : Promise < void > {
79
+ private async extractArchive ( zipPath : string , extractPath : string ) : Promise < void > {
80
80
if ( zipPath . endsWith ( '.zip' ) ) {
81
81
await unzipper . Open . file ( zipPath )
82
82
. then ( d => d . extract ( { path : extractPath } ) ) ;
@@ -87,7 +87,7 @@ export class CxInstaller {
87
87
}
88
88
}
89
89
90
- async downloadFile ( url : string , outputPath : string ) {
90
+ private async downloadFile ( url : string , outputPath : string ) {
91
91
logger . info ( 'Downloading file from:' , url ) ;
92
92
const writer = fs . createWriteStream ( outputPath ) ;
93
93
const response = await axios ( { url, responseType : 'stream' } ) ;
@@ -97,11 +97,11 @@ export class CxInstaller {
97
97
logger . info ( 'Download finished' ) ;
98
98
}
99
99
100
- checkExecutableExists ( ) : boolean {
100
+ private checkExecutableExists ( ) : boolean {
101
101
return fs . existsSync ( this . getExecutablePath ( ) ) ;
102
102
}
103
103
104
- async readASTCLIVersion ( ) : Promise < string > {
104
+ private async readASTCLIVersion ( ) : Promise < string > {
105
105
if ( this . cliVersion ) {
106
106
return this . cliVersion ;
107
107
}
@@ -114,8 +114,8 @@ export class CxInstaller {
114
114
return this . cliDefaultVersion ;
115
115
}
116
116
}
117
-
118
- getCompressFolderName ( ) : string {
117
+
118
+ private getCompressFolderName ( ) : string {
119
119
return `ast-cli.${ this . platform === 'win32' ? 'zip' : 'tar.gz' } ` ;
120
120
}
121
121
}
0 commit comments