Merge pull request #13 from narwabtsze/master
sonar-scanner invocation modified to get real-time output
This commit is contained in:
commit
b17804a3c1
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -58,10 +59,10 @@ func (p Plugin) Exec() error {
|
|||||||
|
|
||||||
cmd := exec.Command("sonar-scanner", args...)
|
cmd := exec.Command("sonar-scanner", args...)
|
||||||
// fmt.Printf("==> Executing: %s\n", strings.Join(cmd.Args, " "))
|
// fmt.Printf("==> Executing: %s\n", strings.Join(cmd.Args, " "))
|
||||||
output, err := cmd.CombinedOutput()
|
cmd.Stdout = os.Stdout
|
||||||
if len(output) > 0 {
|
cmd.Stderr = os.Stderr
|
||||||
fmt.Printf("==> Code Analysis Result: %s\n", string(output))
|
fmt.Printf("==> Code Analysis Result:\n")
|
||||||
}
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user