From 75a3ef30638ce0bc2042621cb93be766047762e0 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Sun, 15 Dec 2024 00:17:47 -0600 Subject: [PATCH] fix(completions): Fix completion generation breaking the build --- internal/generate/completions/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/generate/completions/main.go b/internal/generate/completions/main.go index f4ee70d..ef450da 100644 --- a/internal/generate/completions/main.go +++ b/internal/generate/completions/main.go @@ -8,6 +8,7 @@ import ( "time" "gabe565.com/castsponsorskip/cmd" + "gabe565.com/utils/cobrax" flag "github.com/spf13/pflag" ) @@ -39,13 +40,12 @@ func main() { var buf bytes.Buffer rootCmd.SetOut(&buf) - for _, shell := range []string{"bash", "zsh", "fish"} { - rootCmd.SetArgs([]string{"--completion=" + shell}) - if err := rootCmd.Execute(); err != nil { + for _, shell := range []cobrax.Shell{cobrax.Bash, cobrax.Zsh, cobrax.Fish} { + if err := cobrax.GenCompletion(rootCmd, shell); err != nil { panic(err) } - f, err := os.Create(filepath.Join("completions", name+"."+shell)) + f, err := os.Create(filepath.Join("completions", name+"."+string(shell))) if err != nil { panic(err) }