File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
NotifierBot/Sources/Notifier/Commands
urlwatcher/Sources/urlwatcher Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,9 @@ struct InfoCommand: Command {
7373 let errorDuration = Date ( ) . timeIntervalSince ( errorDate)
7474 errorDurationString = SharedUtils . muteDurationFormatter. string ( from: errorDuration)
7575 }
76- lines. append ( " - Errored: \( errored ? " Yes (for \( errorDurationString ?? " an unknown time " ) ) " : " No " ) " )
76+ lines. append ( " - Errored: \( errored ? " Yes (for \( errorDurationString ?? " an unknown time " ) ) " : " No " ) " . escaped ( ) )
7777 let notified = FileManager . default. fileExists ( atPath: " \( entryPath) /.notified " )
78- lines. append ( " - Notified: \( notified ? " Yes " : " No " ) " )
78+ lines. append ( " - Notified: \( notified ? " Yes " : " No " ) " . escaped ( ) )
7979 return lines. joined ( separator: " \n " )
8080 }
8181
Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ func handleScreenshotError(entry: URLEntry) throws {
170170 // Check if the user has already been notified
171171 if fileManager. fileExists ( atPath: " \( entryPath) /.notified " ) {
172172 // User has already been notified
173+ print ( " User already notified. " )
173174 return
174175 }
175176
@@ -185,8 +186,8 @@ func handleScreenshotError(entry: URLEntry) throws {
185186 // and create the "notified" file to indicate that the user has already been notified about this error
186187 try notifyError ( entry: entry)
187188 let notifiedFile = " \( SharedUtils . directory ( for: entry) ) /.notified "
188- if fileManager. fileExists ( atPath: notifiedFile) {
189- try fileManager. removeItem ( atPath: notifiedFile)
189+ if ! fileManager. fileExists ( atPath: notifiedFile) {
190+ fileManager. createFile ( atPath: notifiedFile, contents : nil )
190191 }
191192 }
192193 }
You can’t perform that action at this time.
0 commit comments