Skip to content

Commit

Permalink
Fix catalog compilation when no mappings are passed
Browse files Browse the repository at this point in the history
Only attempt to compute the longest key of mappings when mappings are
actually passed.
  • Loading branch information
smortex committed Sep 10, 2024
1 parent 1deae36 commit 04dd721
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templates/conf.d/map.epp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ map <%= $string %> $<%= $name %> {
<%- $include_files.each |$h| { -%>
include <%= $h %>;
<%- } -%>
<%- unless $mappings.empty { -%>

<%-
$m = $mappings ? {
Expand All @@ -28,4 +29,5 @@ $field_width = $m.map |$x| { $x['key'].length }.max
<%- $m.each |$h| { -%>
<%= sprintf("%-*s %s", $field_width, $h['key'], $h['value']) %>;
<%- } -%>
<%- } -%>
}

0 comments on commit 04dd721

Please sign in to comment.