From 7f1201a89bc6eb3348699b360eda73510389590e Mon Sep 17 00:00:00 2001 From: rsteube Date: Thu, 22 Feb 2024 00:00:39 +0100 Subject: [PATCH] bash: trim `.bash` from completion scripts --- pkg/bridges/bash.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/bridges/bash.go b/pkg/bridges/bash.go index 1e832b7..6d8531e 100644 --- a/pkg/bridges/bash.go +++ b/pkg/bridges/bash.go @@ -6,7 +6,6 @@ import ( "runtime" "strings" - "github.com/rsteube/carapace" "github.com/rsteube/carapace/pkg/execlog" ) @@ -23,13 +22,13 @@ func Bash() []string { for _, location := range bashCompletionLocations() { entries, err := os.ReadDir(location) if err != nil { - carapace.LOG.Println(err.Error()) continue } for _, entry := range entries { if !entry.IsDir() && !strings.HasPrefix(entry.Name(), "_") { - unique[entry.Name()] = true + name := strings.TrimSuffix(entry.Name(), ".bash") + unique[name] = true } } }