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

Commit 0b6fb55

Browse files
committed
#46 Exit with sonar-scanner exit code
1 parent ee1246c commit 0b6fb55

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

dist/index.js

+14-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ function scanCLI(cliArgs, params, callback) {
2626

2727
// determine the command to run and execute it
2828
sonarQubeExecutable(sqScannerCommand => {
29-
exec(sqScannerCommand, cliArgs, optionsExec)
30-
log('SonarQube analysis finished.')
31-
callback()
29+
try {
30+
exec(sqScannerCommand, cliArgs, optionsExec)
31+
log('SonarQube analysis finished.')
32+
callback()
33+
} catch (error) {
34+
process.exit(error.status)
35+
}
3236
})
3337
}
3438

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

4448
// determine the command to run and execute it
4549
localSonarQubeExecutable(sqScannerCommand => {
46-
exec(sqScannerCommand, [], optionsExec)
47-
log('SonarQube analysis finished.')
48-
callback()
50+
try {
51+
exec(sqScannerCommand, [], optionsExec)
52+
log('SonarQube analysis finished.')
53+
callback()
54+
} catch (error) {
55+
process.exit(error.status)
56+
}
4957
})
5058
}

0 commit comments

Comments
 (0)