1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Fix extraction of export template

folder name changes in Godot 4
This commit is contained in:
Elias Steurer 2023-11-16 09:52:35 +01:00
parent b72c9904b2
commit 269b70093d
2 changed files with 6 additions and 8 deletions

View File

@ -108,8 +108,6 @@ def main():
description='Build and Package ScreenPlay') description='Build and Package ScreenPlay')
parser.add_argument('--skip-aqt', action="store_true", dest="skip_aqt", parser.add_argument('--skip-aqt', action="store_true", dest="skip_aqt",
help="Downloads QtCreator and needed binaries Windows: C:\\aqt\\nLinux & macOS:~/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() args = parser.parse_args()
root_path = Path(util.cd_repo_root_path()) root_path = Path(util.cd_repo_root_path())
@ -117,7 +115,7 @@ def main():
vcpkg_path = project_source_parent_path.joinpath("vcpkg").resolve() vcpkg_path = project_source_parent_path.joinpath("vcpkg").resolve()
vcpkg_packages_list = defines.VCPKG_BASE_PACKAGES vcpkg_packages_list = defines.VCPKG_BASE_PACKAGES
if system() != "Darwin" and args.setup_godot: if system() != "Darwin":
if not setup_godot.execute(): if not setup_godot.execute():
raise RuntimeError("Unable to download godot") raise RuntimeError("Unable to download godot")

View File

@ -35,16 +35,16 @@ def unzip_godot(exe_zip_filepath: str, export_templates_filepath: str, destinati
util.unzip(exe_zip_filepath, destination_path) 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 # 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 # with the folder structure where the version comes after: /home/eli/.local/share/godot/export_templates/
# Rename: AppData\Roaming\Godot\templates\templates # Rename: AppData\Roaming\Godot\export_templates\templates
# to : AppData\Roaming\Godot\templates\3.4.stable # to : AppData\Roaming\Godot\export_templates\3.4.stable
godot_templates_dir = "" godot_templates_dir = ""
if sys.platform == "win32": if sys.platform == "win32":
godot_templates_dir = os.path.join( godot_templates_dir = os.path.join(
os.getenv('APPDATA'), "Godot/templates") os.getenv('APPDATA'), "Godot/export_templates")
elif sys.platform == "linux": elif sys.platform == "linux":
godot_templates_dir = os.path.join( 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) os.makedirs(godot_templates_dir, exist_ok=True)
export_templates_destination_version = f"{godot_templates_dir}/{defines.GODOT_VERSION}.{defines.GODOT_RELEASE_TYPE}" export_templates_destination_version = f"{godot_templates_dir}/{defines.GODOT_VERSION}.{defines.GODOT_RELEASE_TYPE}"