Actually assert that things return successfully

This commit is contained in:
Gwilym Kuiper 2022-10-02 17:51:30 +01:00
parent 52adc63581
commit 0c0e9e7165

View file

@ -61,20 +61,20 @@ pub fn release(matches: &clap::ArgMatches) -> Result<(), Error> {
directory_name.to_string_lossy() directory_name.to_string_lossy()
); );
Command::new("cargo") assert!(Command::new("cargo")
.arg("update") .arg("update")
.current_dir(directory_name) .current_dir(directory_name)
.output() .status()
.map_err(|_| Error::CargoUpdateFailed)?; .map_err(|_| Error::CargoUpdateFailed)?
.success());
} }
Command::new("just") assert!(Command::new("just")
.arg("ci") .arg("ci")
.current_dir(&root_directory) .current_dir(&root_directory)
.spawn() .status()
.map_err(|_| Error::JustCiFailed)? .map_err(|_| Error::JustCiFailed)?
.wait() .success());
.map_err(|_| Error::JustCiFailed)?;
if !dry_run { if !dry_run {
execute_git_command( execute_git_command(
@ -166,6 +166,8 @@ fn execute_git_command(root_directory: &Path, args: &[&str]) -> Result<String, E
.output() .output()
.map_err(|_| Error::Git("Failed to run command"))?; .map_err(|_| Error::Git("Failed to run command"))?;
assert!(git_cmd.status.success());
String::from_utf8(git_cmd.stdout).map_err(|_| Error::Git("Output not utf-8")) String::from_utf8(git_cmd.stdout).map_err(|_| Error::Git("Output not utf-8"))
} }