From 200d438908329a5955cf8fafca358dd3c99e98f8 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 21 Feb 2026 23:00:34 +1300 Subject: [PATCH] Update source/src/templates.cpp --- source/src/templates.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/src/templates.cpp b/source/src/templates.cpp index c947258..a740186 100644 --- a/source/src/templates.cpp +++ b/source/src/templates.cpp @@ -355,7 +355,11 @@ info << "Template extracted successfully. SHA256: " << actual_unpacked_hash << std::endl; std::filesystem::path template_info_env_path = template_cache_dir / filenames::template_info_env; - ASSERT( std::filesystem::exists( template_info_env_path ), "template_info.env doesn't exist in the template." ); + if (!std::filesystem::exists(template_info_env_path)) { + error << "template_info.env doesn't exist in template '" << template_name << "'" << std::endl; + std::filesystem::remove_all(template_cache_dir); + return template_info(); + } // Update cache JSON file nlohmann::json cache_json; @@ -448,7 +452,9 @@ for (const auto& source : mSources) { auto source_templates = source->get_template_list(); for (const auto& t : source_templates) { - if (seen.insert(t).second) + if (!seen.insert(t).second) + continue; + if (source->template_command_exists(t, "install")) result.push_back({t, source->get_description()}); } }