}
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) {
}
return err
}
- var pth string
for _, fi := range fis {
- pth, err = filepath.Rel(Cwd, path.Join(root, fi.Name()))
- if err != nil {
- panic(err)
- }
+ 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)
}
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
}