2 Commits

Author SHA1 Message Date
1c23b4f975 fix command path 2026-03-29 23:20:51 +01:00
48172fd99e skip pre run hook for completion/help commands 2026-03-29 23:13:47 +01:00

View File

@@ -25,6 +25,11 @@ var rootCmd = &cobra.Command{
It allows users to easily create and manage .gitignore files for various programming languages and frameworks. It allows users to easily create and manage .gitignore files for various programming languages and frameworks.
You may also list available templates and generate .gitignore files based on those templates.`, You may also list available templates and generate .gitignore files based on those templates.`,
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
if strings.HasPrefix(cmd.CommandPath(), "gogn completion") ||
strings.HasPrefix(cmd.CommandPath(), "gogn help") {
return nil
}
client, err := gogi.NewHTTPClient() client, err := gogi.NewHTTPClient()
if err != nil { if err != nil {
return fmt.Errorf("error creating HTTP client: %w", err) return fmt.Errorf("error creating HTTP client: %w", err)