Skip to content

Commit

Permalink
Fixed download locations and rebuild loop
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Sep 19, 2023
1 parent 44ad8cc commit ba2169c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hooks/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ def on_pre_build(config: MkDocsConfig):
base = os.path.dirname(config.config_file_path)
project_name = os.path.basename(base)

archive = f"{config.docs_dir}/download.zip"
archive = f"docs/download/{project_name}.zip"
os.makedirs(os.path.dirname(archive), exist_ok = True)
with ZipFile(archive, "w", ZIP_DEFLATED, False) as f:
for name in os.listdir(base):
# @todo: load ignore patterns from .gitignore
if name == "site":
continue
if name.endswith(".zip"):
continue

# Find all files recursively and add them to the archive
path = os.path.join(base, name)
Expand Down

0 comments on commit ba2169c

Please sign in to comment.