Skip to content

Commit

Permalink
Helper messages for documenting build process
Browse files Browse the repository at this point in the history
I don't have `goimport` installed, and running `make` as described
in https://cli.urfave.org/CONTRIBUTING/#development-workflow fails.

Took this opportunity to enhance the process a bit.

I see that `zz_generated.flags.go` is invalid without `goimports`
(for whatever reason it is needed). And I need to check why
`goimports` is not installed into `./.local/bin` automatically.
  • Loading branch information
abitrolly committed Jul 22, 2023
1 parent 2f36a1f commit c54dfd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.*envrc
.envrc
.idea
# goimports is installed here if not available
/.local/
/site/
coverage.txt
Expand Down
3 changes: 3 additions & 0 deletions internal/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func main() {
{
Name: "generate",
Action: GenerateActionFunc,
Usage: "generate API docs",
},
{
Name: "yamlfmt",
Expand Down Expand Up @@ -496,6 +497,7 @@ func checkBinarySizeActionFunc(c *cli.Context) (err error) {
func GenerateActionFunc(cCtx *cli.Context) error {
top := cCtx.Path("top")

log.Println("--- generating godoc-current.txt API reference ---")
cliDocs, err := sh("go", "doc", "-all", top)
if err != nil {
return err
Expand All @@ -514,6 +516,7 @@ func GenerateActionFunc(cCtx *cli.Context) error {
return err
}

log.Println("--- generating Go source files ---")
return runCmd("go", "generate", cCtx.Path("top")+"/...")
}

Expand Down

0 comments on commit c54dfd0

Please sign in to comment.