From 02d44b090d43b21c389a3cdc4d26e45ac3677ec4 Mon Sep 17 00:00:00 2001 From: IamEld3st Date: Tue, 7 Apr 2020 17:26:03 +0200 Subject: [PATCH] Update build.py --- build.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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/')