MCPcopy Create free account
hub / github.com/github/gh-aw / uninstallFishCompletion

Function uninstallFishCompletion

pkg/cli/shell_completion.go:503–527  ·  view source on GitHub ↗

uninstallFishCompletion uninstalls fish completion

(verbose bool)

Source from the content-addressed store, hash-verified

501
502// uninstallFishCompletion uninstalls fish completion
503func uninstallFishCompletion(verbose bool) error {
504 shellCompletionLog.Print("Uninstalling fish completion")
505
506 homeDir, err := os.UserHomeDir()
507 if err != nil {
508 return fmt.Errorf("failed to get home directory: %w", err)
509 }
510
511 completionPath := filepath.Join(homeDir, ".config", "fish", "completions", "gh-aw.fish")
512
513 if _, err := os.Stat(completionPath); err != nil {
514 return fmt.Errorf("no fish completion file found at: %s", completionPath)
515 }
516
517 shellCompletionLog.Printf("Found completion file at: %s", completionPath)
518
519 if err := os.Remove(completionPath); err != nil {
520 return fmt.Errorf("failed to remove completion file: %w", err)
521 }
522
523 fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Removed fish completion from: "+completionPath))
524 fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Fish will automatically detect the removal on next shell start"))
525
526 return nil
527}
528
529// uninstallPowerShellCompletion uninstalls PowerShell completion
530func uninstallPowerShellCompletion(verbose bool) error {

Calls 5

FormatSuccessMessageFunction · 0.92
FormatInfoMessageFunction · 0.92
PrintMethod · 0.80
ErrorfMethod · 0.45
PrintfMethod · 0.45

Tested by 2