Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completions: ignore errors on cask list generation. #16452

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Library/Homebrew/completions/bash.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ then
fi

__brewcomp_words_include() {
local element idx
local element idx
for (( idx = 1; idx < COMP_CWORD; idx++ ))
do
element=${COMP_WORDS[idx]}
Expand Down Expand Up @@ -88,7 +88,7 @@ __brew_complete_outdated_formulae() {
__brew_complete_outdated_casks() {
local cur="${COMP_WORDS[COMP_CWORD]}"
local outdated_casks
outdated_casks="$(brew outdated --cask --quiet)"
outdated_casks="$(brew outdated --cask --quiet 2>/dev/null)"
while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${outdated_casks}" -- "${cur}")
}

Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/completions/zsh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ __brew_installed_casks() {

local -a list
local expl
list=( $(brew list --cask) )
list=( $(brew list --cask 2>/dev/null) )
_wanted list expl 'installed casks' compadd -a list
}

__brew_outdated_casks() {
[[ -prefix '-' ]] && return 0

local -a casks
casks=($(brew outdated --cask))
casks=($(brew outdated --cask 2>/dev/null))
_describe -t casks 'outdated casks' casks
}

Expand Down