From 8f193cf195e6f575a2e2dcef4a94daa5031417d3 Mon Sep 17 00:00:00 2001 From: Lena <126529524+acuteenvy@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:05:13 +0200 Subject: [PATCH] fix: make `--render` work again --- tldr.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tldr.py b/tldr.py index 6713ae8..3749988 100755 --- a/tldr.py +++ b/tldr.py @@ -638,8 +638,9 @@ def main() -> None: print('\n'.join(get_commands(options.platform, options.language))) elif options.render: for command in options.command: - if Path(command).exists(): - with command.open(encoding='utf-8') as open_file: + file_path = Path(command) + if file_path.exists(): + with file_path.open(encoding='utf-8') as open_file: output(open_file.read().encode('utf-8').splitlines(), plain=options.markdown) elif options.search: