Skip to content

Commit

Permalink
Tidy mage package output: only display links on failure, fix failin…
Browse files Browse the repository at this point in the history
…g fleet config embed (elastic#6547)

* Only log links on error.

* Fix failing to pack fleet config file.
  • Loading branch information
cmacknz authored Jan 20, 2025
1 parent 7d1aaae commit 3d0dc86
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
7 changes: 3 additions & 4 deletions dev-tools/cmd/buildfleetcfg/buildfleetcfg.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion dev-tools/mage/gotool/linkcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
package gotool

import (
"fmt"

"github.com/magefile/mage/sh"
)

Expand All @@ -15,7 +17,13 @@ var LinkCheck goLinkCheck = runGoLinkCheck

func runGoLinkCheck(opts ...ArgOpt) error {
args := buildArgs(opts).build()
return sh.RunV("link-patrol", args...)
output, err := sh.Output("link-patrol", args...)
if err != nil {
fmt.Println(output)
return err
}

return nil
}

func (goLinkCheck) Path(path string) ArgOpt { return flagArgIf("-f", path) }
2 changes: 1 addition & 1 deletion internal/pkg/agent/application/configuration_embed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ func BuildFleetCfg() error {
out := filepath.Join("internal", "pkg", "agent", "application", "configuration_embed.go")

fmt.Printf(">> BuildFleetCfg %s to %s\n", in, out)
return RunGo("run", goF, "--in", in, "--out", out)
return RunGo("run", goF, "--in", in, "--output", out)
}

// Enroll runs agent which enrolls before running.
Expand Down

0 comments on commit 3d0dc86

Please sign in to comment.