notifications: escape all quotes in applescript on macos

pull/144/head
Manos Pitsidianakis 2 years ago
parent ce269c64e1
commit ca84906d7d

@ -213,7 +213,7 @@ impl Component for NotificationCommand {
} else { } else {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
{ {
let applescript = format!("display notification \"{message}\" with title \"{title}\" subtitle \"{subtitle}\"", message = body.replace('"', "'"), title = title.as_ref().map(String::as_str).unwrap_or("meli"), subtitle = kind.map(|k| k.to_string()).unwrap_or_default()); let applescript = format!("display notification \"{message}\" with title \"{title}\" subtitle \"{subtitle}\"", message = body.replace('"', "'"), title = title.as_ref().map(String::as_str).unwrap_or("meli").replace('"', "'"), subtitle = kind.map(|k| k.to_string()).unwrap_or_default().replace('"', "'"));
match Command::new("osascript") match Command::new("osascript")
.arg("-e") .arg("-e")
.arg(applescript) .arg(applescript)

Loading…
Cancel
Save