Skip to content

Commit

Permalink
Fix cases where conditionals were wiping out the whole line and cases…
Browse files Browse the repository at this point in the history
… where '\' were breaking podman builds
  • Loading branch information
Asa Rentschler committed Sep 19, 2024
1 parent 7a7e07b commit 7b00d32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/velocity/_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _filter_content(cls, image: Image, text: str) -> str:
res: re_Match[str] = re_match(r".*(\?\?([\S ]*)\|>(.*)\?\?).*", text)
if res is not None:
if image.satisfies(res.group(2)):
text = re_sub(r".*(\?\?.*\?\?).*", res.group(3), text)
text = re_sub(r"(\?\?.*\?\?)", res.group(3).strip(), text)
else:
text = ""

Expand Down Expand Up @@ -290,7 +290,7 @@ def _run(self, contents: list[str], label_contents: list[str]) -> list[str]:
ln += " "
ln += alt_cmd
# add '&& \\' to all but the last line
if cmd != contents[-1]:
if cmd != contents[-1] and cmd[-1] != '\\': # ignore line that end in an escape
ln += " && \\"
ret.append(ln)
return ret
Expand Down

0 comments on commit 7b00d32

Please sign in to comment.