Skip to content

Commit

Permalink
fixed undoParentsBackup method
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-przybyl-wttech committed Mar 20, 2024
1 parent 645d958 commit fe4c5df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/content/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,14 @@ func (c Manager) doRootBackup(root string) error {

func (c Manager) undoParentsBackup(root string) error {
return eachParentFiles(root, func(parent string) error {
if err := eachFilesInDir(parent, func(path string) error {
if !strings.HasSuffix(path, ParentsBackupSuffix) {
return deleteFile(path, nil)
}
return nil
}); err != nil {
return err
}
return eachFilesInDir(parent, func(path string) error {
if strings.HasSuffix(path, ParentsBackupSuffix) {
origin := strings.TrimSuffix(path, ParentsBackupSuffix)
Expand Down

0 comments on commit fe4c5df

Please sign in to comment.