Skip to content

Commit dc88f49

Browse files
Fixed sending images for paths with spaces
Fixed change notification displaying "old.png" instead of the NCC
1 parent aa435c6 commit dc88f49

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NotifierBot/Sources/Notifier/JFUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct JFUtils {
4848
}
4949

5050
static private func sendImageOrFile(path: String, chatID: Int64, isFile: Bool, text: String? = nil) {
51-
var command = "\(kTelegramScript) -t \(token!) -c \(chatID) -\(isFile ? "f" : "i") \(path)"
51+
var command = "\(kTelegramScript) -t \(token!) -c \(chatID) -\(isFile ? "f" : "i") \"\(path)\""
5252
if let text = text {
5353
// Encase the lines in parantheses
5454
let lines = text.components(separatedBy: .newlines).map({ "\"\($0)\"" })

urlwatcher/urlwatcher.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ while IFS='' read -r line || [ -n "${line}" ]; do
238238

239239
# If there was a change
240240
if ! screenshotsMatch "old.png" "latest.png"; then
241-
reportChange "$NAME" "latest.png" $(cat "$NCC_FILE")
241+
# Read the NCC from the file
242+
NCC=$(cat "$NCC_FILE" | grep "all: " | cut -d ':' -f2 | xargs)
243+
reportChange "$NAME" "latest.png" "$NCC"
242244
fi
243245

244246
# After successfully checking for changes (either no change, or change notified)

0 commit comments

Comments
 (0)