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

Commit

Permalink
#46 Exit with sonar-scanner exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
bellingard committed Feb 23, 2019
1 parent ee1246c commit 0b6fb55
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ function scanCLI(cliArgs, params, callback) {

// determine the command to run and execute it
sonarQubeExecutable(sqScannerCommand => {
exec(sqScannerCommand, cliArgs, optionsExec)
log('SonarQube analysis finished.')
callback()
try {
exec(sqScannerCommand, cliArgs, optionsExec)
log('SonarQube analysis finished.')
callback()
} catch (error) {
process.exit(error.status)
}
})
}

Expand All @@ -43,8 +47,12 @@ function scanUsingCustomSonarQubeScanner(params, callback) {

// determine the command to run and execute it
localSonarQubeExecutable(sqScannerCommand => {
exec(sqScannerCommand, [], optionsExec)
log('SonarQube analysis finished.')
callback()
try {
exec(sqScannerCommand, [], optionsExec)
log('SonarQube analysis finished.')
callback()
} catch (error) {
process.exit(error.status)
}
})
}

0 comments on commit 0b6fb55

Please sign in to comment.