aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/udt-palette15
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/udt-palette b/bin/udt-palette
index 7f53e88..9fd202c 100755
--- a/bin/udt-palette
+++ b/bin/udt-palette
@@ -689,7 +689,20 @@ def generate(roles_path, out_dir, scheme=None):
scheme, palette, res, snap_names = load(roles_path, scheme=scheme)
written = []
for target, fn, template in TARGETS:
- dest = out_dir / target
+ # A target outside this repo (the conky dashboard) is an absolute path,
+ # and `out_dir / absolute` discards out_dir entirely. For the real
+ # render that is what we want, since the file genuinely belongs at that
+ # path. For a render aimed elsewhere it is not: selftest renders every
+ # scheme to a temp dir to have rofi parse the result, and an escaping
+ # absolute target rewrote the live file each time, silently leaving the
+ # user's config set to whichever scheme was probed last.
+ #
+ # So honour an absolute target only for the default in-repo render, and
+ # rebase it under out_dir whenever a caller asked for somewhere else.
+ if Path(target).is_absolute() and out_dir != REPO:
+ dest = out_dir / Path(target).relative_to("/")
+ else:
+ dest = out_dir / target
if template:
src = REPO / template
if not src.exists():