Correct the logic for updating the agb version in the examples

This commit is contained in:
GBA bot 2022-01-01 12:36:47 +00:00
parent 55c9aea76f
commit 85c81fdc7c

View file

@ -75,10 +75,11 @@ git add "$DIRECTORY/Cargo.toml" "$DIRECTORY/Cargo.lock"
if [ "$PROJECT" = "agb" ]; then if [ "$PROJECT" = "agb" ]; then
# also update the agb version in the template and the examples # also update the agb version in the template and the examples
sed -i -e "s/^agb = \".*\"/agb = \"$VERSION\"/" template/Cargo.toml examples/*/Cargo.toml sed -i -e "s/^agb = \".*\"/agb = \"$VERSION\"/" template/Cargo.toml
git add template/Cargo.toml git add template/Cargo.toml
for EXAMPLE_DIR in examples/*/; do for EXAMPLE_DIR in examples/*/; do
sed -i -e "/agb =/ s/version = \"[0-9.]+\"/version = \"$VERSION\"/" "$EXAMPLE_DIR/Cargo.toml"
(cd "$EXAMPLE_DIR" && cargo update) (cd "$EXAMPLE_DIR" && cargo update)
git add "$EXAMPLE_DIR"/{Cargo.toml,Cargo.lock} git add "$EXAMPLE_DIR"/{Cargo.toml,Cargo.lock}
done done