From 9463eb53cdda60195a30c0cea8f867cc1126c531 Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Sat, 5 Sep 2020 20:40:24 -0400 Subject: [PATCH] check that cache directory for platform exists Signed-off-by: Matthew Peveler --- tldr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tldr.py b/tldr.py index 501402f..52849e9 100755 --- a/tldr.py +++ b/tldr.py @@ -243,6 +243,8 @@ def get_commands(platforms=None): if os.path.exists(get_cache_dir()): for platform in platforms: path = os.path.join(get_cache_dir(), 'pages', platform) + if not os.path.exists(path): + continue commands += [file[:-3] for file in os.listdir(path) if file.endswith(".md")] return commands