diff --git a/lib/adapter/git_adapter.py b/lib/adapter/git_adapter.py index 0ce4d31..0ff52a0 100644 --- a/lib/adapter/git_adapter.py +++ b/lib/adapter/git_adapter.py @@ -43,7 +43,7 @@ class RepositoryAdapter(Adapter): self._cheatsheet_files_prefix, topic) - if os.path.exists(filename): + if os.path.exists(filename) and not os.path.isdir(filename): answer = self._format_page(open(filename, 'r').read()) else: # though it should not happen diff --git a/lib/adapter/tldr.py b/lib/adapter/tldr.py index 5e14884..9b32434 100644 --- a/lib/adapter/tldr.py +++ b/lib/adapter/tldr.py @@ -73,15 +73,16 @@ class Tldr(GitRepositoryAdapter): and as soon as anything is found, format and return it. """ - search_order = ['common', 'linux', 'osx', 'sunos', 'windows'] + search_order = ['common', 'linux', 'osx', 'sunos', 'windows', "android"] local_rep = self.local_repository_location() ext = self._cheatsheet_files_extension filename = None for subdir in search_order: - filename = os.path.join( + _filename = os.path.join( local_rep, 'pages', subdir, "%s%s" % (topic, ext)) - if os.path.exists(filename): + if os.path.exists(_filename): + filename = _filename break if filename: