mirror of
https://github.com/onyx-and-iris/gogn.git
synced 2026-03-30 14:09:19 +00:00
skip pre run hook for completion/help commands
This commit is contained in:
parent
5983f286d1
commit
48172fd99e
5
main.go
5
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.
|
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(), "exclude completion") ||
|
||||||
|
strings.HasPrefix(cmd.CommandPath(), "exclude 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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user