Skip to content

Commit

Permalink
Parents backup undo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian-panek-vmltech committed Mar 19, 2024
1 parent 21874d7 commit 88ec003
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/content/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,15 @@ func (c Manager) doRootBackup(root string) error {
}

func (c Manager) undoParentsBackup(root string) error {
return eachFilesInDir(root, func(path string) error {
if strings.HasSuffix(path, ParentsBackupSuffix) {
origin := strings.TrimSuffix(path, ParentsBackupSuffix)
log.Infof("undoing backup of parent file: %s", path)
return os.Rename(path, origin)
}
return nil
return eachParentFiles(root, func(parent string) error {
return eachFilesInDir(parent, func(path string) error {
if strings.HasSuffix(path, ParentsBackupSuffix) {
origin := strings.TrimSuffix(path, ParentsBackupSuffix)
log.Infof("undoing backup of parent file: %s", path)
return os.Rename(path, origin)
}
return nil
})
})
}

Expand Down

0 comments on commit 88ec003

Please sign in to comment.