Merge pull request #13 from narwabtsze/master

sonar-scanner invocation modified to get real-time output
This commit is contained in:
Rogan 2020-02-18 22:49:53 +08:00 committed by GitHub
commit b17804a3c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
"os"
"os/exec"
"strings"
)
@ -58,10 +59,10 @@ func (p Plugin) Exec() error {
cmd := exec.Command("sonar-scanner", args...)
// fmt.Printf("==> Executing: %s\n", strings.Join(cmd.Args, " "))
output, err := cmd.CombinedOutput()
if len(output) > 0 {
fmt.Printf("==> Code Analysis Result: %s\n", string(output))
}
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
fmt.Printf("==> Code Analysis Result:\n")
err := cmd.Run()
if err != nil {
return err
}