mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Fix release script (#766)
Causes the release script to update build-dependencies and the desktop tracker - [x] no changelog update needed
This commit is contained in:
commit
dd5ab9b475
|
@ -111,7 +111,7 @@ fn update_to_version(
|
||||||
&[
|
&[
|
||||||
"agb-*/Cargo.toml",
|
"agb-*/Cargo.toml",
|
||||||
"agb/Cargo.toml",
|
"agb/Cargo.toml",
|
||||||
"tracker/agb-*/Cargo.toml",
|
"tracker/*/Cargo.toml",
|
||||||
"examples/*/Cargo.toml",
|
"examples/*/Cargo.toml",
|
||||||
"book/games/*/Cargo.toml",
|
"book/games/*/Cargo.toml",
|
||||||
"template/Cargo.toml",
|
"template/Cargo.toml",
|
||||||
|
@ -123,21 +123,28 @@ fn update_to_version(
|
||||||
.parse::<toml_edit::DocumentMut>()
|
.parse::<toml_edit::DocumentMut>()
|
||||||
.map_err(|_| Error::InvalidToml(cargo_toml_file.to_string_lossy().into_owned()))?;
|
.map_err(|_| Error::InvalidToml(cargo_toml_file.to_string_lossy().into_owned()))?;
|
||||||
|
|
||||||
if let Some(this_dep) = cargo_toml["dependencies"].get_mut(&project_name) {
|
let to_update = ["dependencies", "build-dependencies"];
|
||||||
match this_dep {
|
|
||||||
toml_edit::Item::Value(s @ toml_edit::Value::String(_)) => {
|
for kind in to_update {
|
||||||
*s = new_version.clone().into()
|
if let Some(this_dep) = cargo_toml
|
||||||
}
|
.get_mut(kind)
|
||||||
toml_edit::Item::Value(toml_edit::Value::InlineTable(t)) => {
|
.and_then(|x| x.get_mut(&project_name))
|
||||||
t["version"] = new_version.clone().into()
|
{
|
||||||
}
|
match this_dep {
|
||||||
toml_edit::Item::None => continue,
|
toml_edit::Item::Value(s @ toml_edit::Value::String(_)) => {
|
||||||
_ => {
|
*s = new_version.clone().into()
|
||||||
return Err(Error::InvalidToml(format!(
|
}
|
||||||
"{:?} while searching dependencies in {}",
|
toml_edit::Item::Value(toml_edit::Value::InlineTable(t)) => {
|
||||||
this_dep,
|
t["version"] = new_version.clone().into()
|
||||||
cargo_toml_file.to_string_lossy()
|
}
|
||||||
)))
|
toml_edit::Item::None => continue,
|
||||||
|
_ => {
|
||||||
|
return Err(Error::InvalidToml(format!(
|
||||||
|
"{:?} while searching dependencies in {}",
|
||||||
|
this_dep,
|
||||||
|
cargo_toml_file.to_string_lossy()
|
||||||
|
)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue