cleanup.go | 9 +++++---- diff --git a/cleanup.go b/cleanup.go index 2c32ab26109a94f5822540028d8eee3f9e3955b5d9e465fd523daebaad8fcdc9..d034a939d92d1130eed8dcb58a4e67a5a8b91519924e18426cb175a7dd9faf18 100644 --- a/cleanup.go +++ b/cleanup.go @@ -22,6 +22,7 @@ "fmt" "io" "log" "os" + "path" "path/filepath" "strings" ) @@ -93,13 +94,13 @@ break } return err } - var pth string for _, fi := range fis { - pth = cwdMustRel(root, fi.Name()) + pth := path.Join(root, fi.Name()) + pthRel := cwdMustRel(root, fi.Name()) if fi.IsDir() { if fi.Name() == RedoDir { if what == CleanupFull { - fmt.Println(pth) + fmt.Println(pthRel) err = os.RemoveAll(pth) } else { err = redoDirClean(pth, what) @@ -114,7 +115,7 @@ continue } if (what == CleanupTmp || what == CleanupFull) && strings.HasPrefix(fi.Name(), TmpPrefix) { - fmt.Println(pth) + fmt.Println(pthRel) if err = os.Remove(pth); err != nil { return err }