Merge pull request #303 from erijo/default-template-if

This commit is contained in:
Tim Byrne 2021-02-15 12:57:45 -06:00
commit d11e094f7b
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
1 changed files with 2 additions and 2 deletions

4
yadm
View File

@ -411,13 +411,13 @@ function replace_vars() {
} }
} }
function conditions() { function conditions() {
pattern = ifs blank "*(" pattern = ifs blank "+("
for (label in c) { for (label in c) {
value = c[label] value = c[label]
gsub(/[\\.^$(){}\[\]|*+?]/, "\\\\&", value) gsub(/[\\.^$(){}\[\]|*+?]/, "\\\\&", value)
pattern = sprintf("%syadm\\.%s" blank "*==" blank "*\"%s\"|", pattern, label, value) pattern = sprintf("%syadm\\.%s" blank "*==" blank "*\"%s\"|", pattern, label, value)
} }
sub(/\|$/,")",pattern) sub(/\|$/, ")" blank "*%}$", pattern)
return pattern return pattern
} }
EOF EOF