Skip to content

Commit

Permalink
Merge pull request #139 from scop/refactor/bash-completion-path
Browse files Browse the repository at this point in the history
Update bash completion path
  • Loading branch information
nao1215 committed Apr 8, 2024
2 parents 3f583a6 + bb64092 commit 9f70b68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ func TestExecute_Completion(t *testing.T) {
t.Error(err)
}

bash := filepath.Join(os.Getenv("HOME"), ".bash_completion.d", cmdinfo.Name)
bash := filepath.Join(os.Getenv("HOME"), ".local", "share", "bash-completion", "completions", cmdinfo.Name)
if runtime.GOOS == "windows" {
if file.IsFile(bash) {
t.Errorf("generate %s, however shell completion file is not generated on Windows", bash)
Expand Down
2 changes: 1 addition & 1 deletion internal/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func isSameZshCompletionFile(cmd *cobra.Command) bool {

// bashCompletionFilePath return bash-completion file path.
func bashCompletionFilePath() string {
return filepath.Join(os.Getenv("HOME"), ".bash_completion.d", cmdinfo.Name)
return filepath.Join(os.Getenv("HOME"), ".local", "share", "bash-completion", "completions", cmdinfo.Name)
}

// fishCompletionFilePath return fish-completion file path.
Expand Down

0 comments on commit 9f70b68

Please sign in to comment.