Skip to content

Commit 439aac1

Browse files
Update plugin.go
1 parent 3c26b8f commit 439aac1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,11 @@ func (p Plugin) Exec() error {
473473
params := strings.Split(p.Config.CustomJvmParams, ",")
474474
args = append(args, params...)
475475
}
476-
476+
workspaceFolder := ".scannerwork/report-task.txt"
477+
477478
if len(p.Config.Workspace) >= 1 {
478479
args = append(args, "-Dsonar.projectBaseDir="+p.Config.Workspace)
480+
workspaceFolder = p.Config.Workspace+"/.scannerwork/report-task.txt"
479481
}
480482

481483
// Assuming your struct has a print or log method
@@ -531,7 +533,7 @@ func (p Plugin) Exec() error {
531533
fmt.Printf("\n==> Sonar Analysis Finished!\n\n")
532534
fmt.Printf("\n\nStatic Analysis Result:\n\n")
533535

534-
cmd = exec.Command("cat", ".scannerwork/report-task.txt")
536+
cmd = exec.Command("cat", workspaceFolder)
535537

536538
cmd.Stdout = os.Stdout
537539

0 commit comments

Comments
 (0)