Skip to content

Commit

Permalink
Bug fix in rmOldCamera.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel-Dorta committed Sep 5, 2019
1 parent d84efd0 commit 5bf48c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/rmOldCamera/rmOldCamera.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ func iterateYears(path string) []error {

if yearInt < earliestTimeToPreserve.Year() {
return os.RemoveAll(filepath.Join(path, yearDir.Name()))
} else if yearInt > earliestTimeToPreserve.Year() {
return nil
}

errs = append(errs, iterateMonths(filepath.Join(path, yearDir.Name()))...)
Expand All @@ -86,6 +88,8 @@ func iterateMonths(path string) []error {

if monthInt < int(earliestTimeToPreserve.Month()) {
return os.RemoveAll(filepath.Join(path, monthDir.Name()))
} else if monthInt > int(earliestTimeToPreserve.Month()) {
return nil
}

errs = append(errs, iterateDays(filepath.Join(path, monthDir.Name()))...)
Expand Down

0 comments on commit 5bf48c1

Please sign in to comment.