Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-przybyl-wttech committed Mar 20, 2024
1 parent 0354b3f commit 645d958
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/content/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,10 @@ func (c Manager) flattenFile(path string) error {

func (c Manager) deleteFiles(root string) error {
if err := eachParentFiles(root, func(parent string) error {
return deleteFile(parent, func() bool {
return matchAnyRule(parent, parent, c.FilesDeleted)
return eachFilesInDir(parent, func(path string) error {
return deleteFile(path, func() bool {
return matchAnyRule(path, path, c.FilesDeleted)
})
})
}); err != nil {
return err
Expand All @@ -268,10 +270,9 @@ func (c Manager) deleteFiles(root string) error {
}

func (c Manager) deleteBackupFiles(root string) error {
patterns := []string{".*" + ParentsBackupSuffix}
return eachFiles(root, func(path string) error {
return deleteFile(path, func() bool {
return matchString(path, patterns)
return strings.HasSuffix(path, ParentsBackupSuffix)
})
})
}
Expand Down

0 comments on commit 645d958

Please sign in to comment.