From 096e583618e58594f736afe1769bda1066ff2c90 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 19 Jun 2026 02:40:13 +1000 Subject: [PATCH] fix: only match dirs when globs if a tail is given --- src/caelestia/utils/dots/manifest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/caelestia/utils/dots/manifest.py b/src/caelestia/utils/dots/manifest.py index 8a516fb..4cfefd4 100644 --- a/src/caelestia/utils/dots/manifest.py +++ b/src/caelestia/utils/dots/manifest.py @@ -57,7 +57,10 @@ class ManifestEntry: glob_idx = max(i for i, part in enumerate(parts) if _GLOB_MAGIC.search(part)) pattern = str(Path(*parts[: glob_idx + 1])) tail = parts[glob_idx + 1 :] - return [Path(match, *tail) for match in sorted(glob.glob(pattern))] + matches = sorted(glob.glob(pattern)) + if tail: # Only match dirs if a tail exists + matches = [match for match in matches if Path(match).is_dir()] + return [Path(match, *tail) for match in matches] @dataclass(frozen=True)