diff --git a/Library/Homebrew/completions/bash.erb b/Library/Homebrew/completions/bash.erb index 55d2d13dc0..6bab42bbc6 100644 --- a/Library/Homebrew/completions/bash.erb +++ b/Library/Homebrew/completions/bash.erb @@ -59,7 +59,7 @@ __brew_complete_casks() { __brew_complete_installed_formulae() { local cur="${COMP_WORDS[COMP_CWORD]}" 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}") } diff --git a/completions/bash/brew b/completions/bash/brew index abe94e31cf..1426bf06ff 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -46,7 +46,7 @@ __brew_complete_casks() { __brew_complete_installed_formulae() { local cur="${COMP_WORDS[COMP_CWORD]}" 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}") }