From 044ffb3ba26f767cbffebcb62e25896789c3de37 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Wed, 12 Jan 2022 22:23:23 +0000 Subject: [PATCH] Only try to run in folders with a Cargo.toml file --- release.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release.sh b/release.sh index 0de4ad46..9e90d56c 100755 --- a/release.sh +++ b/release.sh @@ -81,7 +81,8 @@ if [ "$PROJECT" = "agb" ]; then sed -i -e "s/^agb = \".*\"/agb = \"$VERSION\"/" template/Cargo.toml git add template/Cargo.toml - for EXAMPLE_DIR in examples/*/ book/games/*/; do + for EXAMPLE_TOML_FILE in examples/*/Cargo.toml book/games/*/Cargo.toml; do + EXAMPLE_DIR=$(dirname "$EXAMPLE_TOML_FILE") sed -E -i -e "/agb =/ s/version = \"[^\"]+\"/version = \"$VERSION\"/" "$EXAMPLE_DIR/Cargo.toml" (cd "$EXAMPLE_DIR" && cargo update) git add "$EXAMPLE_DIR"/{Cargo.toml,Cargo.lock} @@ -95,8 +96,6 @@ else git add "$CARGO_TOML_FILE" "${CARGO_TOML_FILE/.toml/.lock}" done - - git add agb/Cargo.toml agb/Cargo.lock fi # Sanity check to make sure the build works @@ -104,7 +103,8 @@ for CARGO_TOML_FILE in agb-*/Cargo.toml agb/Cargo.toml; do (cd "$(dirname "$CARGO_TOML_FILE")" && cargo test) done -for EXAMPLE_DIR in examples/*/; do +for EXAMPLE_TOML_FILE in examples/*/Cargo.toml book/games/*/Cargo.toml; do + EXAMPLE_DIR=$(dirname "$EXAMPLE_TOML_FILE") (cd "$EXAMPLE_DIR" && cargo check --release) done