X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=cleanup.go;h=e00e3ff299842929f37ea8a5129abe82d36b68ea;hb=0d0e69d21056fe2c199beb7e7ce82572ae688825;hp=8c757aeebcf4c58d2b1e96ba5e93fa10e0c4b271;hpb=3d2efdb8e781a148ab3633405534534dfd8c7545;p=goredo.git diff --git a/cleanup.go b/cleanup.go index 8c757ae..e00e3ff 100644 --- a/cleanup.go +++ b/cleanup.go @@ -1,6 +1,6 @@ /* goredo -- djb's redo implementation on pure Go -Copyright (C) 2020-2021 Sergey Matveev +Copyright (C) 2020-2022 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -122,6 +122,12 @@ func cleanupWalker(root, what string) error { } else { err = redoDirClean(pth, what) } + } else if (what == CleanupTmp || what == CleanupFull) && + strings.HasPrefix(fi.Name(), TmpPrefix) { + fmt.Println(pthRel) + if !*DryRun { + err = os.RemoveAll(pth) + } } else { err = cleanupWalker(pth, what) }