1
0
mirror of https://github.com/Jguer/yay.git synced 2026-02-18 06:12:16 +01:00
yay/pkg/completion
Jo 3d7701fa35
fix: automatically regenerate empty completion cache (#2773)
Fixes #2759

The completion cache validation now checks if the file is empty and
automatically regenerates it. This prevents shell completions from
breaking when the cache file exists but is corrupted or empty.

Previously, NeedsUpdate() only checked file existence and age, but
didn't validate file contents. Empty cache files would be used as-is,
causing 'yay -Pc' to return no output and breaking shell completions.

Changes:
- Add file size check in NeedsUpdate() to detect empty cache files
- Add test case for empty file scenario
- Update function documentation
2026-01-30 10:33:43 +01:00
..