Skip to content

fix: update assets URL and create directories recursively #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tldr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down