Skip to content

Commit e474620

Browse files
committed
[cli/screenshot] Forgot that .urgency doesn't exist on macOS/Windows
1 parent 928082a commit e474620

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

src/cli/cmds/screenshot.rs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,14 @@ pub async fn execute(mut cmd: Cmd) -> eyre::Result<()> {
137137

138138
#[cfg(feature = "os-notifier")]
139139
show_notification(cmd.system_notifications, &config, |notif| {
140-
notif
141-
.body(&format!(
142-
"received status code {} while running command '{}'",
143-
output.status.code().unwrap_or(-1),
144-
binary.display()
145-
))
146-
.urgency(notify_rust::Urgency::Critical);
140+
notif.body(&format!(
141+
"received status code {} while running command '{}'",
142+
output.status.code().unwrap_or(-1),
143+
binary.display()
144+
));
145+
146+
#[cfg(target_os = "linux")]
147+
notif.urgency(notify_rust::Urgency::Critical);
147148
});
148149

149150
exit(1);
@@ -175,12 +176,13 @@ pub async fn execute(mut cmd: Cmd) -> eyre::Result<()> {
175176

176177
#[cfg(feature = "os-notifier")]
177178
show_notification(cmd.system_notifications, &config, |notif| {
178-
notif
179-
.body(&format!(
180-
"received unexpected JSON payload from server `{}` [status code: {}]",
181-
server, status
182-
))
183-
.urgency(notify_rust::Urgency::Critical);
179+
notif.body(&format!(
180+
"received unexpected JSON payload from server `{}` [status code: {}]",
181+
server, status
182+
));
183+
184+
#[cfg(target_os = "linux")]
185+
notif.urgency(notify_rust::Urgency::Critical);
184186
});
185187
}
186188

@@ -192,9 +194,10 @@ pub async fn execute(mut cmd: Cmd) -> eyre::Result<()> {
192194

193195
#[cfg(feature = "os-notifier")]
194196
show_notification(cmd.system_notifications, &config, |notif| {
195-
notif
196-
.body(&format!("received message from server: {message}"))
197-
.urgency(notify_rust::Urgency::Critical);
197+
notif.body(&format!("received message from server: {message}"));
198+
199+
#[cfg(target_os = "linux")]
200+
notif.urgency(notify_rust::Urgency::Critical);
198201
});
199202

200203
if cmd.no_copy || clipboard.is_none() {

0 commit comments

Comments
 (0)