Skip to content

Commit

Permalink
Merge pull request #14540 from maxim-belkin/speedup_tap_completions
Browse files Browse the repository at this point in the history
Bash completions: speed up Tap completions
  • Loading branch information
MikeMcQuaid authored Feb 7, 2023
2 parents 66fe57e + d8e07e2 commit ff5e517
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Library/Homebrew/completions/bash.erb
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ __brew_complete_outdated_casks() {

__brew_complete_tapped() {
local dir taps taplib
taplib="$(brew --repository)/Library/Taps"
taplib=${HOMEBREW_REPOSITORY:-$(brew --repository)}/Library/Taps

for dir in "${taplib}"/*/*
do
[[ -d "${dir}" ]] || continue
dir="${dir#"${taplib}"/}"
dir="${dir/homebrew-/}"
taps="${taps} ${dir}"
[[ -d ${dir} ]] || continue
dir=${dir#"${taplib}"/}
dir=${dir/homebrew-/}
taps+=" ${dir}"
done
__brewcomp "${taps}"
}
Expand Down
10 changes: 5 additions & 5 deletions completions/bash/brew
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ __brew_complete_outdated_casks() {

__brew_complete_tapped() {
local dir taps taplib
taplib="$(brew --repository)/Library/Taps"
taplib=${HOMEBREW_REPOSITORY:-$(brew --repository)}/Library/Taps

for dir in "${taplib}"/*/*
do
[[ -d "${dir}" ]] || continue
dir="${dir#"${taplib}"/}"
dir="${dir/homebrew-/}"
taps="${taps} ${dir}"
[[ -d ${dir} ]] || continue
dir=${dir#"${taplib}"/}
dir=${dir/homebrew-/}
taps+=" ${dir}"
done
__brewcomp "${taps}"
}
Expand Down

0 comments on commit ff5e517

Please sign in to comment.