Skip to content

Commit f029e67

Browse files
vitorhclspageektti
andauthored
fix: update assets URL and create directories recursively (#245)
* fix: update DOWNLOAD_CACHE_LOCATION and create directories recursively in cache update * fix: use GitHub latest release URL for downloading --------- Co-authored-by: spageektti <[email protected]>
1 parent c8982a3 commit f029e67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tldr.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
).rstrip('/')
2929
DOWNLOAD_CACHE_LOCATION = os.environ.get(
3030
'TLDR_DOWNLOAD_CACHE_LOCATION',
31-
'https://tldr-pages.github.io/assets/tldr.zip'
31+
'https://github.com/tldr-pages/tldr/releases/latest/download/tldr.zip'
3232
)
3333

3434
USE_NETWORK = int(os.environ.get('TLDR_NETWORK_ENABLED', '1')) > 0
@@ -115,7 +115,7 @@ def store_page_to_cache(
115115
) -> Optional[str]:
116116
try:
117117
cache_file_path = get_cache_file_path(command, platform, language)
118-
cache_file_path.parent.mkdir(exist_ok=True)
118+
cache_file_path.parent.mkdir(parents=True, exist_ok=True)
119119
with cache_file_path.open("wb") as cache_file:
120120
cache_file.write(page)
121121
except Exception:

0 commit comments

Comments
 (0)