aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gen_markdown.go
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gen_markdown.go')
-rw-r--r--doc/gen_markdown.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/doc/gen_markdown.go b/doc/gen_markdown.go
index ee87d544..47194666 100644
--- a/doc/gen_markdown.go
+++ b/doc/gen_markdown.go
@@ -4,20 +4,32 @@ package main
import (
"fmt"
- "github.com/MichaelMure/git-bug/commands"
- "github.com/spf13/cobra/doc"
"log"
"os"
"path"
+ "path/filepath"
+
+ "github.com/MichaelMure/git-bug/commands"
+ "github.com/spf13/cobra/doc"
)
func main() {
cwd, _ := os.Getwd()
- filepath := path.Join(cwd, "doc", "md")
+ dir := path.Join(cwd, "doc", "md")
fmt.Println("Generating Markdown documentation ...")
- err := doc.GenMarkdownTree(commands.RootCmd, filepath)
+ files, err := filepath.Glob(dir + "/*.md")
+ if err != nil {
+ log.Fatal(err)
+ }
+ for _, f := range files {
+ if err := os.Remove(f); err != nil {
+ log.Fatal(err)
+ }
+ }
+
+ err = doc.GenMarkdownTree(commands.RootCmd, dir)
if err != nil {
log.Fatal(err)
}