Exclude media in generated directory (#1118)

This commit is contained in:
WithoutPants
2021-02-11 11:06:04 +11:00
committed by GitHub
parent 7609969491
commit bbc34bd1bf
3 changed files with 11 additions and 1 deletions

View File

@@ -41,7 +41,9 @@ func (t *CleanTask) shouldClean(path string) bool {
// use image.FileExists for zip file checking
fileExists := image.FileExists(path)
if !fileExists || getStashFromPath(path) == nil {
// #1102 - clean anything in generated path
generatedPath := config.GetGeneratedPath()
if !fileExists || getStashFromPath(path) == nil || utils.IsPathInDir(generatedPath, path) {
logger.Infof("File not found. Cleaning: \"%s\"", path)
return true
}