From 5dfc83ad7a961e2ba845993d1eee5cea2197a789 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lopes" Date: Wed, 11 Mar 2026 12:10:56 +0000 Subject: [PATCH] fix stale link detection when base files dir missing --- internal/core/ops.go | 7 +++++++ main.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/core/ops.go b/internal/core/ops.go index a30781a..fcc7db2 100644 --- a/internal/core/ops.go +++ b/internal/core/ops.go @@ -154,6 +154,13 @@ func FindStaleLinksMulti(filesDirs []string, targetRoot string) ([]string, error // First pass: walk source directories to find files that exist for _, filesDir := range filesDirs { + if _, err := os.Stat(filesDir); err != nil { + if errors.Is(err, os.ErrNotExist) { + continue + } + return nil, err + } + filesAbs, err := filepath.Abs(filesDir) if err != nil { return nil, err diff --git a/main.go b/main.go index 8f0a083..7ac562a 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,7 @@ import ( "sigil/internal/core" ) -const version = "0.2.0" +const version = "0.2.1" func main() { if len(os.Args) < 2 {