Skip to content

Commit

Permalink
fix(pre-commit): Always generate usage docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Apr 10, 2024
1 parent f8c19b0 commit 35758e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ repos:
name: usage-docs
entry: go run ./internal/generate/docs
language: system
files: ^(generate|internal/generate/docs)
pass_filenames: false
8 changes: 7 additions & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ func openAndTemplate(cmd *cobra.Command, conf config.Config, p string) error {
}

if ext := filepath.Ext(path); ext == ".yaml" || ext == ".yml" {
return openAndTemplateFile(cmd, conf, path)
if _, err := io.WriteString(cmd.OutOrStdout(), "---\n"); err != nil {
return err
}

if err := openAndTemplateFile(cmd, conf, path); err != nil {
return err
}
}

return nil
Expand Down

0 comments on commit 35758e4

Please sign in to comment.