summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-05-16 19:06:24 +0200
committerewy <ewy0@protonmail.com>2026-05-16 19:06:24 +0200
commit00379affbb5f8483fcda9bcf2291106fac574110 (patch)
tree6659535afe2e244a65bc17b1b71047e28b07a662
parente24077dcfa5e40d2c7888ff3cb4c10626e0e8c2c (diff)
fix bug :(
-rw-r--r--cache/cache.go3
-rw-r--r--main.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/cache/cache.go b/cache/cache.go
index b4cd989..9e6b1bc 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -139,6 +139,9 @@ func Insert(in *model.State) error {
}
insert := New(in)
result := loaded.Merge(insert)
+ if loaded == nil {
+ return SaveFile(Path, result)
+ }
if slices.Equal(loaded.Entries, result.Entries) {
return nil
}
diff --git a/main.go b/main.go
index 843be56..036504c 100644
--- a/main.go
+++ b/main.go
@@ -147,6 +147,9 @@ func pik() int {
if !*flags.All {
st, stateErrors = model.NewState(fs, locs, indexers, runners)
go func() {
+ if len(stateErrors) > 0 {
+ return
+ }
err := cache.Insert(st)
if err != nil {
spool.Warn("%v\n", err)