From 269b70093de2bd6d40bf00ff0d3f601ba34546b4 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Thu, 16 Nov 2023 09:52:35 +0100 Subject: [PATCH] Fix extraction of export template folder name changes in Godot 4 --- Tools/setup.py | 4 +--- Tools/setup_godot.py | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Tools/setup.py b/Tools/setup.py index 765c9847..ef3163e0 100755 --- a/Tools/setup.py +++ b/Tools/setup.py @@ -108,8 +108,6 @@ def main(): description='Build and Package ScreenPlay') parser.add_argument('--skip-aqt', action="store_true", dest="skip_aqt", help="Downloads QtCreator and needed binaries Windows: C:\\aqt\\nLinux & macOS:~/aqt/.") - parser.add_argument('--setup-godot', action="store_true", dest="setup_godot", - help="Downloads Godot Editor.") args = parser.parse_args() root_path = Path(util.cd_repo_root_path()) @@ -117,7 +115,7 @@ def main(): vcpkg_path = project_source_parent_path.joinpath("vcpkg").resolve() vcpkg_packages_list = defines.VCPKG_BASE_PACKAGES - if system() != "Darwin" and args.setup_godot: + if system() != "Darwin": if not setup_godot.execute(): raise RuntimeError("Unable to download godot") diff --git a/Tools/setup_godot.py b/Tools/setup_godot.py index 6456c9ff..32de041b 100644 --- a/Tools/setup_godot.py +++ b/Tools/setup_godot.py @@ -35,16 +35,16 @@ def unzip_godot(exe_zip_filepath: str, export_templates_filepath: str, destinati util.unzip(exe_zip_filepath, destination_path) # The export templates contain a templates subfolder in which the content is. This is bad because it clashes - # with the folder structure where the version comes after: AppData\Roaming\Godot\templates\3.3.4.stable - # Rename: AppData\Roaming\Godot\templates\templates - # to : AppData\Roaming\Godot\templates\3.4.stable + # with the folder structure where the version comes after: /home/eli/.local/share/godot/export_templates/ + # Rename: AppData\Roaming\Godot\export_templates\templates + # to : AppData\Roaming\Godot\export_templates\3.4.stable godot_templates_dir = "" if sys.platform == "win32": godot_templates_dir = os.path.join( - os.getenv('APPDATA'), "Godot/templates") + os.getenv('APPDATA'), "Godot/export_templates") elif sys.platform == "linux": godot_templates_dir = os.path.join( - str(Path.home()), ".local/share/godot/templates") + str(Path.home()), ".local/share/godot/export_templates") os.makedirs(godot_templates_dir, exist_ok=True) export_templates_destination_version = f"{godot_templates_dir}/{defines.GODOT_VERSION}.{defines.GODOT_RELEASE_TYPE}"