]> Cypherpunks.ru repositories - goredo.git/blobdiff - cleanup.go
DOT generation
[goredo.git] / cleanup.go
index a98510d1ec4d7763913310cd194484decce9ea68..bb9564cdc43285bd97472774693771bbd5feef04 100644 (file)
@@ -22,7 +22,6 @@ import (
        "io"
        "log"
        "os"
-       "path"
        "path/filepath"
        "strings"
 )
@@ -52,10 +51,7 @@ func redoDirClean(root, what string) error {
                }
                var pth string
                for _, fi := range fis {
-                       pth, err = filepath.Rel(Cwd, path.Join(root, fi.Name()))
-                       if err != nil {
-                               panic(err)
-                       }
+                       pth = cwdMustRel(root, fi.Name())
                        switch what {
                        case CleanupLog:
                                if strings.HasSuffix(fi.Name(), LogSuffix) {
@@ -99,10 +95,7 @@ func cleanupWalker(root, what string) error {
                }
                var pth string
                for _, fi := range fis {
-                       pth, err = filepath.Rel(Cwd, path.Join(root, fi.Name()))
-                       if err != nil {
-                               panic(err)
-                       }
+                       pth = cwdMustRel(root, fi.Name())
                        if fi.IsDir() {
                                if fi.Name() == RedoDir {
                                        if what == CleanupFull {