File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
NotifierBot/Sources/Notifier/Commands Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ struct DiffCommand: Command {
3131 return
3232 }
3333 // Send the diff file and the contents of the ncc file
34- let nccInfo = try String ( contentsOfFile: " \( mainDirectory!) /urlwatcher/images/ \( name) / \( nccFile) " )
34+ let nccInfo = try ? String ( contentsOfFile: " \( mainDirectory!) /urlwatcher/images/ \( name) / \( nccFile) " )
3535 JFUtils . sendImage ( path: " \( mainDirectory!) /urlwatcher/images/ \( name) / \( diffFile) " , chatID: chatID, text: nccInfo)
3636 }
3737}
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ function screenshotsMatch {
135135
136136 if [ " NCC" -lt " $NCC_THRESHOLD " ]; then
137137 # The screenshots do not match. The website has changed
138+
138139 # Write detailed NCC information to a file (and don't overwrite the diff file)
139140 compare -verbose -metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " /dev/null > " $NCC_FILE "
140141
@@ -144,6 +145,9 @@ function screenshotsMatch {
144145 fi
145146 fi
146147
148+ # Write detailed NCC information to a file (and don't overwrite the diff file)
149+ compare -verbose -metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " /dev/null > " $NCC_FILE "
150+
147151 # If statement above didn't exit, that means we have no mismatching hashes and therefore the screenshots match (return true)
148152 # In bash: 0 == true
149153 return 0
@@ -224,7 +228,7 @@ while IFS='' read -r line || [ -n "${line}" ]; do
224228
225229 # If the new screenshot is all black or all white (some display error), ignore it
226230 mean=$( convert latest.png -format " %[mean]" info:)
227- if [ " $mean " == " 0" || " $mean " == " 65535" ]; then
231+ if [ " $mean " == " 0" ] || [ " $mean " == " 65535" ]; then
228232 rollBack
229233 # Skip this entry
230234 cd ../..
You can’t perform that action at this time.
0 commit comments