Skip to content

Commit

Permalink
fix(completions): Fix completion generation breaking the build
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Dec 15, 2024
1 parent 8c2d859 commit 75a3ef3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/generate/completions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

"gabe565.com/castsponsorskip/cmd"
"gabe565.com/utils/cobrax"
flag "github.com/spf13/pflag"
)

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 75a3ef3

Please sign in to comment.