Update source/src/templates.cpp
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 33s
Build-Test-Publish / build (linux/arm64) (push) Successful in 1m13s

This commit is contained in:
j
2026-02-21 23:00:34 +13:00
parent 31fc29fdfb
commit 200d438908

View File

@@ -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()});
}
}