From 78031743f585a64aa0f784d39134627e7f388d49 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 2 Jul 2021 18:27:54 +0300 Subject: [PATCH] redo-sources do not fail at no .dep --- sources.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sources.go b/sources.go index 0d36190..1fd4c9d 100644 --- a/sources.go +++ b/sources.go @@ -18,6 +18,7 @@ along with this program. If not, see . package main import ( + "log" "os" "path" "path/filepath" @@ -33,6 +34,9 @@ func sourcesWalker(tgts []string) ([]string, error) { cwd, f := path.Split(path.Join(Cwd, tgt)) fdDep, err := os.Open(path.Join(cwd, RedoDir, f+DepSuffix)) if err != nil { + if os.IsNotExist(err) { + continue + } return nil, err } depInfo, err := depRead(fdDep) @@ -48,7 +52,7 @@ func sourcesWalker(tgts []string) ([]string, error) { } else if depTgtAbsPath != tgtAbsPath { subSrcs, err := sourcesWalker([]string{cwdMustRel(depTgtAbsPath)}) if err != nil { - panic(err) + log.Fatalln(err) } for _, p := range subSrcs { seen[p] = struct{}{} -- 2.44.0