Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
make SONAR_SCANNER_MIRROR_AUTHORIZATION available
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Visan committed Dec 10, 2020
1 parent 2385e62 commit bd34605
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dist/sonar-scanner-executable.js
Expand Up @@ -99,9 +99,16 @@ function getSonarScannerExecutable(passExecutableCallback) {
var baseUrl = process.env.SONAR_SCANNER_MIRROR || process.env.npm_config_sonar_scanner_mirror || SONAR_SCANNER_MIRROR
var fileName = 'sonar-scanner-cli-' + platformBinariesVersion + '-' + targetOS + '.zip'
var downloadUrl = baseUrl + fileName
var baseUrlAuthorization = process.env.SONAR_SCANNER_MIRROR_AUTHORIZATION;
log(`Downloading from ${downloadUrl}`)
log(`(executable will be saved in cache folder: ${installFolder})`)
download(downloadUrl, installFolder, { extract: true })
var options = { extract: true };
if (baseUrlAuthorization) {
options[headers] = {
'Authorization': 'Basic ' + baseUrlAuthorization
}
}
download(downloadUrl, installFolder, options)
.on('response', res => {
bar.total = res.headers['content-length']
res.on('data', data => bar.tick(data.length))
Expand Down

0 comments on commit bd34605

Please sign in to comment.