mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
Run cargo update on all crates after updating the version number
This commit is contained in:
parent
53aa9b5c10
commit
52adc63581
|
@ -42,19 +42,35 @@ pub fn release(matches: &clap::ArgMatches) -> Result<(), Error> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let project_toml_files = glob_many(&root_directory, &["agb-*/Cargo.toml"])?;
|
let project_toml_files = glob_many(&root_directory, &["agb-*/Cargo.toml"])?;
|
||||||
|
let agb_cargo_toml = root_directory.join("agb/Cargo.toml");
|
||||||
|
|
||||||
update_to_version(
|
update_to_version(&root_directory, &agb_cargo_toml, version)?;
|
||||||
&root_directory,
|
|
||||||
&root_directory.join("agb/Cargo.toml"),
|
|
||||||
version,
|
|
||||||
)?;
|
|
||||||
|
|
||||||
for toml_file in project_toml_files {
|
for toml_file in &project_toml_files {
|
||||||
update_to_version(&root_directory, &toml_file, version)?;
|
update_to_version(&root_directory, toml_file, version)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
for toml_file in project_toml_files
|
||||||
|
.iter()
|
||||||
|
.chain(std::iter::once(&agb_cargo_toml))
|
||||||
|
{
|
||||||
|
let directory_name = toml_file.parent().unwrap();
|
||||||
|
|
||||||
|
println!(
|
||||||
|
"Running cargo update in {}",
|
||||||
|
directory_name.to_string_lossy()
|
||||||
|
);
|
||||||
|
|
||||||
|
Command::new("cargo")
|
||||||
|
.arg("update")
|
||||||
|
.current_dir(directory_name)
|
||||||
|
.output()
|
||||||
|
.map_err(|_| Error::CargoUpdateFailed)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Command::new("just")
|
Command::new("just")
|
||||||
.arg("ci")
|
.arg("ci")
|
||||||
|
.current_dir(&root_directory)
|
||||||
.spawn()
|
.spawn()
|
||||||
.map_err(|_| Error::JustCiFailed)?
|
.map_err(|_| Error::JustCiFailed)?
|
||||||
.wait()
|
.wait()
|
||||||
|
@ -174,6 +190,7 @@ pub enum Error {
|
||||||
InvalidToml(String),
|
InvalidToml(String),
|
||||||
WriteTomlFile,
|
WriteTomlFile,
|
||||||
JustCiFailed,
|
JustCiFailed,
|
||||||
|
CargoUpdateFailed,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
|
Loading…
Reference in a new issue