Skip to content

Commit

Permalink
Display directories first in error when cache contains non-cache files
Browse files Browse the repository at this point in the history
  • Loading branch information
superatomic committed Sep 5, 2023
1 parent 99411c6 commit 1221945
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tldr_man/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def ensure_cache_dir_update_safety():
return

problematic_files = [' ' + format_filename(path) + ('/' if path.is_dir() else '')
for path in sorted(CACHE_DIR.iterdir(), key=lambda path: (path.is_dir(), path.name))
for path in sorted(CACHE_DIR.iterdir(), key=lambda path: (path.is_file(), path.name))
if not (path.is_dir() and EXPECTED_CACHE_CONTENT_PATTERN.match(path.name))]

if problematic_files:
Expand Down

0 comments on commit 1221945

Please sign in to comment.