Skip to content

Commit

Permalink
fix probable issue with xcode tests failing
Browse files Browse the repository at this point in the history
  • Loading branch information
erikng committed May 24, 2024
1 parent b536468 commit 34cd108
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Nudge/Utilities/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct AppStateManager {

func getCreationDateForPath(_ path: String, testFileDate: Date?) -> Date? {
let attributes = try? FileManager.default.attributesOfItem(atPath: path)
if attributes?[.size] as? Int == 0 {
if attributes?[.size] as? Int == 0 && testFileDate == nil {
return DateManager().coerceStringToDate(dateString: "2020-08-06T00:00:00Z")
}
let creationDate = attributes?[.creationDate] as? Date
Expand All @@ -119,7 +119,7 @@ struct AppStateManager {

func getModifiedDateForPath(_ path: String, testFileDate: Date?) -> Date? {
let attributes = try? FileManager.default.attributesOfItem(atPath: path)
if attributes?[.size] as? Int == 0 {
if attributes?[.size] as? Int == 0 && testFileDate == nil {
return DateManager().coerceStringToDate(dateString: "2020-08-06T00:00:00Z")
}
let creationDate = attributes?[.modificationDate] as? Date
Expand Down

0 comments on commit 34cd108

Please sign in to comment.