@@ -56,24 +56,24 @@ struct InfoCommand: Command {
5656 if !e. waitElement. isEmpty {
5757 lines. append ( " - Wait Element: " . escaped ( ) + " ` \( e. waitElement. escaped ( ) ) ` " )
5858 }
59- var durationString = " "
59+ var muteDurationString = " "
6060 if let restDuration = e. unmuteDate? . timeIntervalSince ( Date ( ) ) {
61- durationString = SharedUtils . muteDurationFormatter. string ( from: restDuration) ?? " "
61+ muteDurationString = SharedUtils . muteDurationFormatter. string ( from: restDuration) ?? " "
6262 }
63- lines. append ( " - Muted: \( e. isMuted ? " Yes ( \( durationString ) hours remaining) " : " No " ) " . escaped ( ) )
63+ lines. append ( " - Muted: \( e. isMuted ? " Yes ( \( muteDurationString ) hours remaining) " : " No " ) " . escaped ( ) )
6464 let entryPath = SharedUtils . directory ( for: e)
6565
6666 let errorFile = " \( entryPath) /.error "
6767 let errored = FileManager . default. fileExists ( atPath: errorFile)
6868 // The empty string will propagate the error to the formatter below
69- let errorFileContents = try ? String ( contentsOfFile: errorFile) ?? " "
69+ let errorFileContents = ( try ? String ( contentsOfFile: errorFile) ) ?? " "
7070 let errorDate = ISO8601DateFormatter ( ) . date ( from: errorFileContents)
71- var durationString : String ? = nil
71+ var errorDurationString : String ? = nil
7272 if let errorDate = errorDate {
7373 let errorDuration = Date ( ) . timeIntervalSince ( errorDate)
74- durationString = SharedUtils . muteDurationFormatter. string ( from: errorDuration)
74+ errorDurationString = SharedUtils . muteDurationFormatter. string ( from: errorDuration)
7575 }
76- lines. append ( " - Errored: \( errored ? " Yes (for \( durationString ?? " an unknown time " ) ) " : " No " ) " )
76+ lines. append ( " - Errored: \( errored ? " Yes (for \( errorDurationString ?? " an unknown time " ) ) " : " No " ) " )
7777 let notified = FileManager . default. fileExists ( atPath: " \( entryPath) /.notified " )
7878 lines. append ( " - Notified: \( notified ? " Yes " : " No " ) " )
7979 return lines. joined ( separator: " \n " )
0 commit comments