Skip to content

Commit

Permalink
fix extract in itest
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed May 5, 2024
1 parent ae6b5e2 commit 1426041
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/other/patch-prebuilt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@

version="$1"

# Add correct feature to `godot` dependency
# Add correct feature to `godot` dependency.
if [[ "$version" == "nightly" ]]; then
feature="custom-godot"
# Do not use extraFeatures="custom-godot" here. They just want to use nightly Godot with current API.
extraFeatures=""
else
feature="api-$(echo "$version" | tr '.' '-')"
# Extract "major.minor" from "major.minor[.patch]".
extraFeatures=", \"api-$(echo "$version" | cut -d '.' -f 1,2)\""
fi

# Add extra features to the godot dependency (expects existing `features` key).
sed -i "/^godot = /s/\(features = \[\([^]]*\)\)\]/\1, \"$feature\"]/g" itest/rust/Cargo.toml
sed -i "/^godot = /s/\(features = \[\([^]]*\)\)\]/\1$extraFeatures]/g" itest/rust/Cargo.toml

echo "Patched Cargo.toml for version $version (feature $feature)."
echo "Patched Cargo.toml for version $version (extraFeatures $extraFeatures)."

0 comments on commit 1426041

Please sign in to comment.