Update examples when bumping agb version

This commit is contained in:
GBA bot 2022-01-01 12:32:03 +00:00
parent d390a32d8f
commit 55c9aea76f

View file

@ -74,9 +74,14 @@ sed -i -e "s/^version = \".*\"/version = \"$VERSION\"/" "$DIRECTORY/Cargo.toml"
git add "$DIRECTORY/Cargo.toml" "$DIRECTORY/Cargo.lock" git add "$DIRECTORY/Cargo.toml" "$DIRECTORY/Cargo.lock"
if [ "$PROJECT" = "agb" ]; then if [ "$PROJECT" = "agb" ]; then
# also update the agb version in the template # also update the agb version in the template and the examples
sed -i -e "s/^agb = \".*\"/agb = \"$VERSION\"/" template/Cargo.toml sed -i -e "s/^agb = \".*\"/agb = \"$VERSION\"/" template/Cargo.toml examples/*/Cargo.toml
git add template/Cargo.toml git add template/Cargo.toml
for EXAMPLE_DIR in examples/*/; do
(cd "$EXAMPLE_DIR" && cargo update)
git add "$EXAMPLE_DIR"/{Cargo.toml,Cargo.lock}
done
else else
PROJECT_NAME_WITH_UNDERSCORES=$(echo -n "$PROJECT" | tr - _) PROJECT_NAME_WITH_UNDERSCORES=$(echo -n "$PROJECT" | tr - _)
sed -i -E -e "s/($PROJECT_NAME_WITH_UNDERSCORES = .*version = \")[^\"]+(\".*)/\1$VERSION\2/" agb/Cargo.toml sed -i -E -e "s/($PROJECT_NAME_WITH_UNDERSCORES = .*version = \")[^\"]+(\".*)/\1$VERSION\2/" agb/Cargo.toml