Skip to content

Commit

Permalink
style(manpages): Reorder generator code
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Aug 17, 2023
1 parent 73dc80d commit 1525c72
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions internal/generate/manpages/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ func main() {
rootCmd := cmd.NewCommand("beta", "")
name := rootCmd.Name()

f, err := os.Create(filepath.Join("manpages", name+".1.gz"))
if err != nil {
panic(err)
}

gz := gzip.NewWriter(f)

date, err := time.Parse(time.RFC3339, dateParam)
if err != nil {
panic(err)
Expand All @@ -56,14 +49,19 @@ func main() {
Manual: "User Commands",
}

f, err := os.Create(filepath.Join("manpages", name+".1.gz"))
if err != nil {
panic(err)
}
gz := gzip.NewWriter(f)

if err := doc.GenMan(rootCmd, &header, gz); err != nil {
panic(err)
}

if err := gz.Close(); err != nil {
panic(err)
}

if err := f.Close(); err != nil {
panic(err)
}
Expand Down

0 comments on commit 1525c72

Please sign in to comment.