Merge pull request #14599 from maxim-belkin/installed_formulae_cellar

Bash completions: use HOMEBREW_CELLAR, if set
This commit is contained in:
Mike McQuaid 2023-02-13 14:49:37 +00:00 committed by GitHub
commit 31ec835c9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ __brew_complete_casks() {
__brew_complete_installed_formulae() { __brew_complete_installed_formulae() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
local installed_formulae local installed_formulae
installed_formulae="$(command ls "$(brew --cellar)" 2>/dev/null)" installed_formulae="$(command ls "${HOMEBREW_CELLAR:-$(brew --cellar)}" 2>/dev/null)"
while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${installed_formulae}" -- "${cur}") while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${installed_formulae}" -- "${cur}")
} }

View File

@ -46,7 +46,7 @@ __brew_complete_casks() {
__brew_complete_installed_formulae() { __brew_complete_installed_formulae() {
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
local installed_formulae local installed_formulae
installed_formulae="$(command ls "$(brew --cellar)" 2>/dev/null)" installed_formulae="$(command ls "${HOMEBREW_CELLAR:-$(brew --cellar)}" 2>/dev/null)"
while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${installed_formulae}" -- "${cur}") while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${installed_formulae}" -- "${cur}")
} }