Correctly show stdout/stderr when sending mails
This commit is contained in:
parent
0ef5b693e2
commit
7b45de8920
1 changed files with 13 additions and 5 deletions
18
src/main.rs
18
src/main.rs
|
|
@ -504,15 +504,23 @@ fn main() -> Result<()> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let version_dir = &branch_dir.join(&version.to_string());
|
let version_dir = &branch_dir.join(&version.to_string());
|
||||||
let version_dir = version_dir.to_str().ok_or(miette!("Path is not UTF-8"))?;
|
|
||||||
|
|
||||||
let mut sendmail_args = vec!["send-email"];
|
let mut cmd = std::process::Command::new("git");
|
||||||
|
|
||||||
|
cmd.arg("send-email");
|
||||||
if let Some(args) = &config.sendmail_args {
|
if let Some(args) = &config.sendmail_args {
|
||||||
sendmail_args.extend(args.iter().map(|s| s.deref()))
|
cmd.args(args.iter());
|
||||||
}
|
}
|
||||||
sendmail_args.push(version_dir);
|
cmd.arg(version_dir);
|
||||||
|
|
||||||
git_cd(&sendmail_args).wrap_err("Could not send mails")?;
|
let status = cmd
|
||||||
|
.status()
|
||||||
|
.into_diagnostic()
|
||||||
|
.wrap_err("Could not send emails")?;
|
||||||
|
|
||||||
|
if !status.success() {
|
||||||
|
return Err(miette!("Could not send emails"));
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue