Improve update_crates.sh parsing

This commit is contained in:
lepapareil 2024-01-03 13:35:41 +01:00
parent 529cdcf2ce
commit 39fca161bc
No known key found for this signature in database
GPG Key ID: F4F06B068FB00692
2 changed files with 8 additions and 7 deletions

View File

@ -34,10 +34,11 @@ convert_toml_crates_to_key_value() {
grep --extended-regexp --invert-match "^\[|path|^$|^#" |
cut --delimiter ',' --field 1 |
sed "s/version//g" |
tr -d '"{=}' |
tr -d "'" |
tr -s ' ' |
sort
sed "s/=/ = /g" |
tr -d '"{=}' |
tr -d "'" |
tr -s ' ' |
sort
}
get_crate_latest_version() {
@ -88,8 +89,8 @@ update_crate_version_in_toml() {
toml_file="$4"
# update crate version in toml
sed -i -- "s/${crate} = { version = \"${actual_version}\"/${crate} = { version = \"${last_version}\"/g" "${toml_file}"
sed -i -- "s/${crate} = \"${actual_version}\"/${crate} = \"${last_version}\"/g" "${toml_file}"
sed -i -- "s/^${crate}.*=.*{.*version.*=.*\"${actual_version}\"/${crate} = { version = \"${last_version}\"/g" "${toml_file}"
sed -i -- "s/^${crate}.*=.*\"${actual_version}\"/${crate} = \"${last_version}\"/g" "${toml_file}"
if grep --extended-regexp --silent "${crate}.*=.*${last_version}" "${toml_file}"; then
echo "${color_blue}updated to ${last_version}${color_reset}"
else

View File

@ -36,7 +36,7 @@ md5 = "0.7.0"
percent-encoding = "2.3.1"
regex = "1.10.2"
serde = "1.0.194"
serde_json = { version= "1.0.110",features = ["arbitrary_precision"] }
serde_json = { version = "1.0.110", features = ["arbitrary_precision"] }
sha2 = "0.10.8"
url = "2.5.0"
xml-rs = { version = "0.8.19" }