Merge pull request #10145 from kidonng/patch-1

Fix description cache path in Fish completion
This commit is contained in:
Dawid Dziurla 2020-12-25 09:04:19 +01:00 committed by GitHub
commit 5521c76e66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,11 +93,9 @@ function __fish_brew_suggest_formulae_all -d 'Lists all available formulae with
set -q __brew_cache_path
or set -gx __brew_cache_path (brew --cache)
# TODO: Probably drop this since I think that desc_cache.json is no longer generated. Is there a different available cache?
if test -f "$__brew_cache_path/desc_cache.json"
__fish_brew_ruby_parse_json "$__brew_cache_path/desc_cache.json" \
if test -f "$__brew_cache_path/descriptions.json"
__fish_brew_ruby_parse_json "$__brew_cache_path/descriptions.json" \
'.each{ |k, v| puts([k, v].reject(&:nil?).join("\t")) }'
# backup: (note that it lists only formulae names without descriptions)
else
brew formulae
end