Skip to content

Commit

Permalink
Looking for templates also in share/spright directory. 2nd
Browse files Browse the repository at this point in the history
  • Loading branch information
houmain committed Dec 29, 2024
1 parent f8b5182 commit d48ac0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/output_description.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,12 @@ void evaluate_expressions(
}

void resolve_template_filename(std::filesystem::path& template_filename) {
if (template_filename.empty())
return;
auto error_code = std::error_code{ };
for (const auto& prefix : { ".", "./templates", "../share/spright/templates" }) {
const auto resolved = prefix / template_filename;
if (std::filesystem::exists(resolved, error_code)) {
if (std::filesystem::is_regular_file(resolved, error_code)) {
template_filename = resolved;
return;
}
Expand Down

0 comments on commit d48ac0f

Please sign in to comment.