From 354a18285975371fc949cb7fdfa6da2d9610a229 Mon Sep 17 00:00:00 2001 From: Remy Jette Date: Wed, 5 Jul 2023 14:36:46 -0700 Subject: [PATCH] WebHost: Fix docs generation from a .apworld (#1862) zfile.filename is the full path within the archive, so by default zf.extract will maintain that directory structure when extracting. This causes the docs to be placed in the wrong place, as the Javascript code expects them to be placed directly in the game folder. --- WebHost.py | 1 + 1 file changed, 1 insertion(+) diff --git a/WebHost.py b/WebHost.py index eb859ec5852b..45d017cf1f67 100644 --- a/WebHost.py +++ b/WebHost.py @@ -74,6 +74,7 @@ def create_ordered_tutorials_file() -> typing.List[typing.Dict[str, typing.Any]] with zipfile.ZipFile(zipfile_path) as zf: for zfile in zf.infolist(): if not zfile.is_dir() and "/docs/" in zfile.filename: + zfile.filename = os.path.basename(zfile.filename) zf.extract(zfile, target_path) else: source_path = Utils.local_path(os.path.dirname(world.__file__), "docs")