aboutsummaryrefslogtreecommitdiff
path: root/cmd/krino/sort.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/krino/sort.go')
-rw-r--r--cmd/krino/sort.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/krino/sort.go b/cmd/krino/sort.go
index 9e714ba..3e5d951 100644
--- a/cmd/krino/sort.go
+++ b/cmd/krino/sort.go
@@ -69,6 +69,7 @@ func cmdSort(g *globals, names []string, stdout, stderr io.Writer) int {
if setMinAge {
applyMinAge(e, minAge)
}
+ e.CacheDir = cacheDir()
p := palette{on: colourOn(g, stdout)}
// Spec ยง8.4: with neither -y nor -n, krino asks; asking a non-terminal
@@ -213,12 +214,13 @@ func cmdSort(g *globals, names []string, stdout, stderr io.Writer) int {
}
var approved map[string]bool
+ var replaced map[string]plan.Kind
var action rune
if g.yes {
approved, action = approveAll(actionable), 'a'
} else {
var rerr error
- approved, action, rerr = reviewDir(stdout, actionable, d.Root, p)
+ approved, replaced, action, rerr = reviewDir(stdout, actionable, d.Root, p)
if rerr != nil {
fmt.Fprintf(stderr, "krino: %s: %v\n", d.Name, rerr)
exit = 1
@@ -242,6 +244,9 @@ func cmdSort(g *globals, names []string, stdout, stderr io.Writer) int {
return true
}
+ // [t] and [d] in review: the file gets the one step chosen
+ // there instead of the chain its rules planned.
+ dp.Chains = replaceChains(dp.Chains, replaced)
res, aerr := e.Apply(ctx, dp, approved, j, run)
if aerr != nil {
if errors.Is(aerr, context.Canceled) || errors.Is(aerr, context.DeadlineExceeded) {