From c11c11b90c2dc561dd0892c9c4c4ecdab076af7e Mon Sep 17 00:00:00 2001 From: Joshua Rich Date: Mon, 27 May 2024 10:38:09 +1000 Subject: [PATCH] build(mage): :recycle: rework go build command-line --- build/magefiles/build.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build/magefiles/build.go b/build/magefiles/build.go index db1268cc1..83c104bcd 100644 --- a/build/magefiles/build.go +++ b/build/magefiles/build.go @@ -64,9 +64,8 @@ func buildProject(arch string) error { return errors.Join(ErrBuildFailed, err) } + output := "dist/go-hass-agent-" + arch + slog.Info("Running go build...") - if err := sh.RunWithV(envMap, "go", "build", "-ldflags="+ldflags); err != nil { - return errors.Join(ErrBuildFailed, err) - } - return sh.Copy("dist/go-hass-agent-"+arch, "go-hass-agent") + return sh.RunWithV(envMap, "go", "build", "-ldflags="+ldflags, "-o", output) }