Merge pull request #913 from zsh-users/fix-bundle-group

fix bundle group completion
This commit is contained in:
Shohei YOSHIDA 2022-11-14 12:28:01 +09:00 committed by GitHub
commit ec65b307c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -78,11 +78,8 @@ _bundle_gems() {
}
_bundle_groups() {
setopt extendedglob
local gemdir=$(echo (../)#Gemfile(:h))
if [[ -n $gemdir ]]; then
local -a groups=($(cd "$gemdir" && awk '/^ *group *:/{sub(/^ *group *:/, ""); print $1}' Gemfile))
if [[ -e Gemfile ]]; then
local -a groups=(${(@f)"$(awk '/^ *group *:/{sub(/^ *group *:/, ""); print $1}' Gemfile)"})
_values 'groups' $groups
fi
}