Skip to content

Commit

Permalink
Merge pull request #189 from rsteube/bash-trim-suffix
Browse files Browse the repository at this point in the history
bash: trim `.bash` from completion scripts
  • Loading branch information
rsteube authored Feb 21, 2024
2 parents 566035f + 7f1201a commit 5eda4c1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/bridges/bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"runtime"
"strings"

"github.com/rsteube/carapace"
"github.com/rsteube/carapace/pkg/execlog"
)

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

0 comments on commit 5eda4c1

Please sign in to comment.