From 731e839c15e8c23bef8fd0613cad36e1b80388ad Mon Sep 17 00:00:00 2001 From: Vitor Henrique Date: Mon, 10 Jun 2024 15:05:18 -0300 Subject: [PATCH 1/2] fix: update DOWNLOAD_CACHE_LOCATION and create directories recursively in cache update --- tldr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tldr.py b/tldr.py index 4a88c0f..e07fc7f 100755 --- a/tldr.py +++ b/tldr.py @@ -28,7 +28,7 @@ ).rstrip('/') DOWNLOAD_CACHE_LOCATION = os.environ.get( 'TLDR_DOWNLOAD_CACHE_LOCATION', - 'https://tldr-pages.github.io/assets/tldr.zip' + 'https://tldr.sh/assets/tldr.zip' ) USE_NETWORK = int(os.environ.get('TLDR_NETWORK_ENABLED', '1')) > 0 @@ -115,7 +115,7 @@ def store_page_to_cache( ) -> Optional[str]: try: cache_file_path = get_cache_file_path(command, platform, language) - cache_file_path.parent.mkdir(exist_ok=True) + cache_file_path.parent.mkdir(parents=True, exist_ok=True) with cache_file_path.open("wb") as cache_file: cache_file.write(page) except Exception: From 7dd004ee54fc74f66fadf3669ace8cc5b6df922e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Henrique?= <87824454+vitorhcl@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:40:17 -0300 Subject: [PATCH 2/2] fix: use GitHub latest release URL for downloading Co-authored-by: spageektti --- tldr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tldr.py b/tldr.py index e07fc7f..ed8192e 100755 --- a/tldr.py +++ b/tldr.py @@ -28,7 +28,7 @@ ).rstrip('/') DOWNLOAD_CACHE_LOCATION = os.environ.get( 'TLDR_DOWNLOAD_CACHE_LOCATION', - 'https://tldr.sh/assets/tldr.zip' + 'https://github.com/tldr-pages/tldr/releases/latest/download/tldr.zip' ) USE_NETWORK = int(os.environ.get('TLDR_NETWORK_ENABLED', '1')) > 0