The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
grafana/pkg/build/exec.go

35 lines
737 B

package build
import (
"bytes"
"log"
"os"
"os/exec"
"strings"
)
func runError(cmd string, args ...string) ([]byte, error) {
// Can ignore gosec G204 because this function is not used in Grafana, only in the build process.
//nolint:gosec
ecmd := exec.Command(cmd, args...)
bs, err := ecmd.CombinedOutput()
if err != nil {
return nil, err
}
return bytes.TrimSpace(bs), nil
}
func runPrint(cmd string, args ...string) {
log.Println(cmd, strings.Join(args, " "))
// Can ignore gosec G204 because this function is not used in Grafana, only in the build process.
//nolint:gosec
ecmd := exec.Command(cmd, args...)
ecmd.Stdout = os.Stdout
ecmd.Stderr = os.Stderr
err := ecmd.Run()
if err != nil {
log.Fatal(err)
}
}