Skip to content

Commit

Permalink
feat: clean up markup generator binary
Browse files Browse the repository at this point in the history
  • Loading branch information
theseion committed Feb 10, 2024
1 parent 17cfda8 commit 0230d10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@

# Generated files
**/*_doc.go

# Markdown generator binary
generate-doc-yaml-schema
9 changes: 7 additions & 2 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"errors"
"fmt"
"io"
"os"

"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
Expand Down Expand Up @@ -93,11 +94,15 @@ func Test() error {
// Generate Markdown output (printed to terminal)
func Markdown() error {
mg.SerialDeps(Generate)
generatorBinary := "generate-doc-yaml-schema"

if err := sh.RunV("go", "build", "./cmd/generate-doc-yaml-schema"); err != nil {
if err := sh.RunV("go", "build", "./cmd/"+generatorBinary); err != nil {
return err
}
markdown, err := sh.Output("./generate-doc-yaml-schema")

defer os.Remove(generatorBinary)

markdown, err := sh.Output("./" + generatorBinary)
if err != nil {
return err
}
Expand Down

0 comments on commit 0230d10

Please sign in to comment.