X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=sources.go;h=ebfbcb9d9133e2d5ffa1fd09fb299f8c8dfe6c95;hb=34af0e4ad73fb149c9db2c00b0dcc544838a2df2;hp=0d361900527ca0aa1710e2daa7c96e8478075871;hpb=cb183690cc59ad772dab941adc3e9b8d5b90fbc0;p=goredo.git diff --git a/sources.go b/sources.go index 0d36190..ebfbcb9 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,9 +34,15 @@ 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) + if err != nil { + return nil, err + } fdDep.Close() for _, m := range depInfo.ifchanges { depTgt := m["Target"] @@ -48,7 +55,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{}{}