Skip to content

Commit 19e4792

Browse files
authored
check that cache directory for platform exists before using it (#139)
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
1 parent c44604c commit 19e4792

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tldr.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ def get_commands(platforms=None):
243243
if os.path.exists(get_cache_dir()):
244244
for platform in platforms:
245245
path = os.path.join(get_cache_dir(), 'pages', platform)
246+
if not os.path.exists(path):
247+
continue
246248
commands += [file[:-3] for file in os.listdir(path) if file.endswith(".md")]
247249
return commands
248250

0 commit comments

Comments
 (0)