Install export templates from a script.

Godot Version

4.4.1

Question

I’m writing a Gentoo ebuild for a Godot app and I need to make sure that export templates are installed because otherwise editor complains:

ERROR: Cannot export project with preset "Linux 64-bit" due to configuration errors:
No export template found at the expected path:
/home/kaidezee/.local/share/godot/export_templates/4.4.1.stable/linux_debug.x86_64
No export template found at the expected path:
/home/kaidezee/.local/share/godot/export_templates/4.4.1.stable/linux_release.x86_64

And refuses to export the binary. There doesn’t seem to be an option to install them the from command line (godot --help).

The export templates only need to be in a specific file on your computer for them to work (for you, I think it’s at /home/kaidezee/.local/share/godot/export_templates/4.4.1.stable/). You can download them from the Godot website (Scroll down to “All Downloads” and click the export templates for what you need). You should be able to check if the folder exists and if not, copy these files into the folder for it to work.