diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-01-08 08:19:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-08 08:19:39 +0100 |
commit | 6fa716c67b6f17f3818858785619839da060abe7 (patch) | |
tree | 46be5dc0d72358f9f2cdc6a36dc423a6b7d66379 /platform/javascript/export/export.cpp | |
parent | 1de54bb388d61b79ac7180dc4ca7180f863e02c8 (diff) | |
parent | 5011afcb6ad6a7f7eb37a2cb74f28985e70cbc20 (diff) | |
download | redot-engine-6fa716c67b6f17f3818858785619839da060abe7.tar.gz |
Merge pull request #34887 from akien-mga/cli-export-usability
Export: Improve usability of command line interface
Diffstat (limited to 'platform/javascript/export/export.cpp')
-rw-r--r-- | platform/javascript/export/export.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index bbdf6a1f57..93c83f4ff4 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -288,32 +288,32 @@ Ref<Texture> EditorExportPlatformJavaScript::get_logo() const { bool EditorExportPlatformJavaScript::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const { - bool valid = false; String err; + bool valid = false; - if (find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE) != "") - valid = true; - else if (find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG) != "") - valid = true; + // Look for export templates (first official, and if defined custom templates). + + bool dvalid = exists_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG, &err); + bool rvalid = exists_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE, &err); if (p_preset->get("custom_template/debug") != "") { - if (FileAccess::exists(p_preset->get("custom_template/debug"))) { - valid = true; - } else { + dvalid = FileAccess::exists(p_preset->get("custom_template/debug")); + if (!dvalid) { err += TTR("Custom debug template not found.") + "\n"; } } - if (p_preset->get("custom_template/release") != "") { - if (FileAccess::exists(p_preset->get("custom_template/release"))) { - valid = true; - } else { + rvalid = FileAccess::exists(p_preset->get("custom_template/release")); + if (!rvalid) { err += TTR("Custom release template not found.") + "\n"; } } + valid = dvalid || rvalid; r_missing_templates = !valid; + // Validate the rest of the configuration. + if (p_preset->get("vram_texture_compression/for_mobile")) { String etc_error = test_etc2(); if (etc_error != String()) { |