brew-completions
brew-completions copied to clipboard
Implement caching
All the __suggest_*
functions use some output from brew
and some of those commands are quite slow. It doesn't cache and every time you want to complete a formula name, it will run again.
- [x] search if brew has some internal caching that could be used here
- [ ] write some cache files in XDG paths? how/when to invalidate them?
- [ ] can
brew update
be turned off on such commands? or can we hook to it to update the cache?
Note: there's something in ~/Library/Caches/Homebrew/desc_cache.json
It seems that desc_cache.json
got deprecated, so the current cache lookup doesn't work now.
Just thought I'd leave a comment here noting that ~/Library/Caches/Homebrew/descriptions.json
that seems to contain formulae names and their descriptions. A quick search of Homebrew's repo suggest that it functions as a cache for Homebrew.