2024-07-05 14:59:07 +00:00
|
|
|
//go:build generate
|
2024-07-03 14:12:13 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
cliDocs "github.com/urfave/cli-docs/v3"
|
|
|
|
|
|
|
|
"gh.tarampamp.am/error-pages/internal/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
const readmePath = "../../README.md"
|
|
|
|
|
|
|
|
if stat, err := os.Stat(readmePath); err == nil && stat.Mode().IsRegular() {
|
|
|
|
if err = cliDocs.ToTabularToFileBetweenTags(cli.NewApp(""), "error-pages", readmePath); err != nil {
|
|
|
|
panic(err)
|
2024-07-05 14:59:07 +00:00
|
|
|
} else {
|
|
|
|
println("✔ cli docs updated successfully")
|
2024-07-03 14:12:13 +00:00
|
|
|
}
|
|
|
|
} else if err != nil {
|
2024-07-05 14:59:07 +00:00
|
|
|
println("⚠ readme file not found, cli docs not updated:", err.Error())
|
2024-07-03 14:12:13 +00:00
|
|
|
}
|
|
|
|
}
|