+10 -0 +/-1 browse
1 | diff --git a/cli/src/commands.rs b/cli/src/commands.rs |
2 | index 8aebbf3..c4bbacb 100644 |
3 | --- a/cli/src/commands.rs |
4 | +++ b/cli/src/commands.rs |
5 | @@ -637,6 +637,7 @@ pub fn flush_queue(db: &mut Connection, dry_run: bool, verbose: u8, debug: bool) |
6 | let mut child = std::process::Command::new("sh") |
7 | .arg("-c") |
8 | .arg(cmd) |
9 | + .env("TO_ADDRESS", msg.to_addresses.clone()) |
10 | .stdout(Stdio::piped()) |
11 | .stdin(Stdio::piped()) |
12 | .stderr(Stdio::piped()) |
13 | @@ -667,6 +668,15 @@ pub fn flush_queue(db: &mut Connection, dry_run: bool, verbose: u8, debug: bool) |
14 | process" |
15 | )) |
16 | })?; |
17 | + let result = child.wait_with_output()?; |
18 | + if !result.status.success() { |
19 | + return Err(Error::new_external(format!( |
20 | + "{} proccess failed with exit code: {:?}\n{}", |
21 | + cmd, |
22 | + result.status.code(), |
23 | + String::from_utf8(result.stderr).unwrap() |
24 | + ))); |
25 | + } |
26 | Ok::<(), Error>(()) |
27 | })?; |
28 | Ok(()) |