diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-12 12:58:14 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-12 12:58:14 +0200 |
| commit | 24a84671ace373ae331fa83a1ff484990f4dff0e (patch) | |
| tree | a6b6e3949d7dd241f1d13e079dfb982d758c89a2 /internal/engine/match.go | |
| parent | 3b36a48b7ce5a53a9366f3b31f94311f178e2553 (diff) | |
| download | krino-24a84671ace373ae331fa83a1ff484990f4dff0e.tar.gz krino-24a84671ace373ae331fa83a1ff484990f4dff0e.zip | |
krino: planning — chains, placeholders, conflicts, JSON
Diffstat (limited to 'internal/engine/match.go')
| -rw-r--r-- | internal/engine/match.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/engine/match.go b/internal/engine/match.go index 0693bd5..e68a6e8 100644 --- a/internal/engine/match.go +++ b/internal/engine/match.go @@ -16,6 +16,7 @@ import ( "krino/internal/cond" "krino/internal/config" + "krino/internal/plan" "krino/internal/scan" "krino/internal/xdg" ) @@ -312,7 +313,12 @@ func isBusy(path string, suffixes []string) bool { // excludeDirs computes the directories Match and Explain never enter: each // rule's copy/move destination, the Trash, and the directory holding the -// main config file - each kept only when it lies strictly inside d's root. +// main config file - each kept only when it lies strictly inside d's root +// (C3: root itself is not "inside" it here - a rule cannot exclude the very +// directory being scanned. cmd/krino/render.go's relToRoot answers a +// different question, whether a destination is root or beneath it for +// display purposes, and there root does count as inside; the two are each +// correct for their own question, so do not "unify" them). // A destination with no template placeholder excludes exactly that // directory; a destination with a placeholder excludes only the static // part before its first "{", cut back to a full path component (its last @@ -348,7 +354,7 @@ func (e *Engine) excludeDirs(d *Dir) []string { prefix = "" } } - add(resolveDir(prefix, root)) + add(plan.ResolveDir(prefix, root)) } } add(filepath.Join(xdg.DataHome(), "Trash")) |
