From d26c1d1da0d2c61900e9a5dba841d28228dc921c Mon Sep 17 00:00:00 2001 From: RahulPiddeCheckmarx Date: Mon, 10 Jun 2024 11:06:02 +0530 Subject: [PATCH] removed unwanted changes --- CxScan/CxScanV20/services/configReader.ts | 25 +++-------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/CxScan/CxScanV20/services/configReader.ts b/CxScan/CxScanV20/services/configReader.ts index 24272d73..f6f1e17d 100644 --- a/CxScan/CxScanV20/services/configReader.ts +++ b/CxScan/CxScanV20/services/configReader.ts @@ -565,7 +565,7 @@ if(config.scaConfig.isEnableScaResolver) { } if (config.scaConfig.pathToScaResolver == '' || !isScaResolverFileExists){ - config.scaConfig.pathToScaResolver = this.getPathToScaResolver(config.scaConfig.pathToScaResolver,config.enableProxy,config.proxyConfig?.proxyUrl); + config.scaConfig.pathToScaResolver = this.getPathToScaResolver(config.scaConfig.pathToScaResolver); } this.log.info(`Path To SCA Resolver:${config.scaConfig.pathToScaResolver}`); } @@ -649,26 +649,15 @@ Proxy Pass: ******`); } //To get path of SCA Resolver - public getPathToScaResolver(config : string,enableProxy :boolean,proxyUrl :string = ''){ + public getPathToScaResolver(config : string){ let pathToScaResolver; try { let SCAResDowonloadCommand = ''; const child_process = require('child_process'); const userHomeDir = os.homedir(); pathToScaResolver = userHomeDir; - this.log.debug("Downloading SCA Resolver and extracting it to user home directory."); - if (enableProxy) { - this.log.info(`scanConfig.enableProxy is TRUE`); - } - - if (proxyUrl != undefined && proxyUrl != '') { - - this.log.info(`proxyConfig.proxyUrl is TRUE`); - this.log.info(`SCA proxy URL: ` + proxyUrl); - } - let osType = os.type(); switch(osType) { case 'Darwin': @@ -683,15 +672,7 @@ Proxy Pass: ******`); break; case 'Windows_NT': this.log.debug("Downloading and extracting SCA Resolver for windows operating system"); - - if (enableProxy && proxyUrl !=undefined && proxyUrl != '') - { - SCAResDowonloadCommand = `curl -L ${proxyUrl} https://sca-downloads.s3.amazonaws.com/cli/latest/ScaResolver-win64.zip -o ScaResolver.zip && tar -xf ScaResolver.zip && move ScaResolver.exe ` + userHomeDir + ` && del ScaResolver.zip`; - } - else - { - SCAResDowonloadCommand = "curl -L https://sca-downloads.s3.amazonaws.com/cli/latest/ScaResolver-win64.zip -o ScaResolver.zip && tar -xf ScaResolver.zip && move ScaResolver.exe " + userHomeDir + " && del ScaResolver.zip"; - } + SCAResDowonloadCommand = "curl -L https://sca-downloads.s3.amazonaws.com/cli/latest/ScaResolver-win64.zip -o ScaResolver.zip && tar -xf ScaResolver.zip && move ScaResolver.exe " + userHomeDir + " && del ScaResolver.zip"; this.log.debug("Sca Resolver gets downloaded at location: "+userHomeDir); break; }