Use runAndStreamOutput everywhere

This commit is contained in:
kolaente 2020-09-01 09:51:02 +02:00
parent 087c1b352a
commit 9006b6f49c
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 10 deletions

View File

@ -186,10 +186,12 @@ func IntegrationTest() {
runAndStreamOutput("go", "test", Goflags[0], "-p", "1", PACKAGE+"/pkg/integrations")
}
// Formats the code using go fmt
func Fmt() {
}
// Checks if the code is properly formatted with go fmt
func FmtCheck() {
}
@ -199,20 +201,14 @@ func Lint() {
}
// Generates static content into the final binary
func Generate() error {
// TODO: use runAndStreamOutput
return exec.Command("go", "generate", PACKAGE+"/pkg/static").Run()
func Generate() {
runAndStreamOutput("go", "generate", PACKAGE+"/pkg/static")
}
// Builds a vikunja binary, ready to run.
func Build() error {
func Build() {
mg.Deps(Generate)
// TODO: use runAndStreamOutput
cmd := exec.Command("go", "build", Goflags[0], "-tags", Tags, "-ldflags", "-s -w "+Ldflags, "-o", Executable)
fmt.Println(cmd.String())
out, err := cmd.CombinedOutput()
fmt.Print(string(out))
return err
runAndStreamOutput("go", "build", Goflags[0], "-tags", Tags, "-ldflags", "-s -w "+Ldflags, "-o", Executable)
}
func CompressBuild() {