Only update first version field in a Cargo.toml

This commit is contained in:
Michael Vines
2019-08-20 17:05:28 -07:00
parent 8e0f41a790
commit f4534ef12d

View File

@ -94,7 +94,7 @@ for Cargo_toml in "${Cargo_tomls[@]}"; do
# Set new crate version
(
set -x
sed -i "$Cargo_toml" -e "s/^version = \"[^\"]*\"$/version = \"$newVersion\"/"
sed -i "$Cargo_toml" -e "0,/^version =/{s/^version = \"[^\"]*\"$/version = \"$newVersion\"/}"
)
# Fix up the version references to other internal crates