completions/git: Use "_omb_util_glob_expand"

This commit is contained in:
Koichi Murase
2023-03-13 00:05:27 +09:00
parent f6d6dccfa1
commit 20acfcac1a
+3 -1
View File
@@ -13,8 +13,10 @@ function _omb_completion_git_initialize {
# Note: In the case of symbolic link, the true binary name can
# contain prefix or suffix for architectures and versions.
path="${path%/*}"
local files
_omb_util_glob_expand files '"$prefix"/share/{bash-completion/completions/git,git-core/contrib/completion/git-completion.bash}'
local prefix="${path%/bin}" file
for file in "$prefix"/share/{bash-completion/completions/git,git-core/contrib/completion/git-completion.bash}; do
for file in "${files[@]}"; do
if [[ -f $file && -r $file && -s $file ]]; then
source "$file"
return $?