From c0929bf217182cacb45f2231f807e17ead931856 Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Tue, 12 May 2026 08:24:31 -0600 Subject: [PATCH] fix(template_formatter): preserve dash separator around empty conditional When an empty conditional sits between a dot and a dash (e.g. `.{atmos?}-{tag}`), the left-side dot was kept and the dash before the tag was dropped, producing `...DDP5.1.TAG` instead of `...DDP5.1-TAG`. Prefer the dash when it is the right-side separator. Closes #107 --- unshackle/core/utils/template_formatter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unshackle/core/utils/template_formatter.py b/unshackle/core/utils/template_formatter.py index 0f67367..9d0e237 100644 --- a/unshackle/core/utils/template_formatter.py +++ b/unshackle/core/utils/template_formatter.py @@ -73,7 +73,9 @@ class TemplateFormatter: has_left = s[0] in ".- " has_right = s[-1] in ".- " if has_left and has_right: - return s[0] # keep left separator + if s[-1] == "-": + return s[-1] + return s[0] return "" result = re.sub(