From 48172fd99e8348a1fcdaf85ed27f2077e9f998eb Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 29 Mar 2026 23:13:47 +0100 Subject: [PATCH] skip pre run hook for completion/help commands --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index f16a63f..35922ba 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,11 @@ var rootCmd = &cobra.Command{ 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.`, PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + if strings.HasPrefix(cmd.CommandPath(), "exclude completion") || + strings.HasPrefix(cmd.CommandPath(), "exclude help") { + return nil + } + client, err := gogi.NewHTTPClient() if err != nil { return fmt.Errorf("error creating HTTP client: %w", err)