diff --git a/build.py b/build.py index b457c9a..863bb0c 100644 --- a/build.py +++ b/build.py @@ -4,6 +4,7 @@ import json import os import shutil +from pathlib import Path from zipfile import ZipFile, PyZipFile from io import BytesIO @@ -40,6 +41,11 @@ # Iterate over all the files in directory for folderName, subfolders, filenames in os.walk('./build/'): for filename in filenames: - zipObj.write(filename) + # create complete filepath of file in directory + filePath = os.path.join(folderName, filename) + path = Path(filePath) + + # Add file to zip + zipObj.write(path, Path(*path.parts[2:])) shutil.rmtree('./build/')