diff --git a/source/release_files.json b/source/release_files.json index e9d0baa..0611da1 100644 --- a/source/release_files.json +++ b/source/release_files.json @@ -1,8 +1,6 @@ { # End folders with a forward slash (/) "Create" : [ - "./data/", - "./data/DELETE-ME", "./engine/", "./engine/Windows/", "./engine/Linux/", @@ -13,6 +11,7 @@ "./source/", ], "Copy" : [ + "./data/", "./launcher/", "./source/icons/", "./source/tools/", @@ -23,5 +22,12 @@ "./win-build-data.bat", "./win-build-release.bat", "./win-set-icons.bat", + ], + "Delete" : [ + "__pycache__", + "pyminifier", + "build_bgarmor.py", + "build_launcher.py", + ".gitignore", ] } \ No newline at end of file diff --git a/source/tools/Common/helper_scripts/build_bgarmor.py b/source/tools/Common/helper_scripts/build_bgarmor.py index 3652b50..6812331 100644 --- a/source/tools/Common/helper_scripts/build_bgarmor.py +++ b/source/tools/Common/helper_scripts/build_bgarmor.py @@ -59,6 +59,13 @@ print(" > Copied", elementType, "to:", path.as_posix()) - for _path in glob.glob(targetPath.as_posix() + "/**/__pycache__", recursive=True): - shutil.rmtree(_path, ignore_errors=True) + print("\n> Removing unnecessary files and folders:") + for pattern in releaseFilesList["Delete"]: + for _path in glob.glob(targetPath.as_posix() + "/**/" + pattern, recursive=True): + _path = Path(_path) + if _path.is_dir(): + shutil.rmtree(_path.as_posix(), ignore_errors=True) + else: + _path.unlink() + print(" > Removed:", _path)