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.
This commit is contained in:
parent
827444f5a4
commit
354a182859
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue