Skip to content

Commit

Permalink
fix readme version update script
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Tosca committed May 18, 2024
1 parent b9bf6f7 commit ef5cf19
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions scripts/updateReadmeVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

# Replace the version in README.md with the version from build.gradle.kts
# Usage:
# ./scripts/updateReadmeVersion.sh <module>
# Example:
# ./scripts/updateReadmeVersion.sh earth.adi
# ./scripts/updateReadmeVersion.sh

SED="sed"
if ! command -v gsed &> /dev/null
Expand All @@ -13,9 +11,8 @@ then
SED="gsed"
fi

VERSION=$(SED -n 's/^version\s*=\s*"\([0-9]\.[0-9]\.[0-9]\)"/\1/p' < build.gradle.kts)
VERSION=$(SED -n "s/^version\s*'\([0-9]\.[0-9]\.[0-9]\)'/\1/p" < build.gradle)

echo "Updating to version $VERSION in README.md..."
SED -i -E 's/earth\.adi:.+:[0-9]+\.[0-9]+\.[0-9]+/earth\.adi:.+:'"${VERSION}"'/' README.md
SED -i -E 's|<version>[0-9]+\.[0-9]+\.[0-9]+|<version>'"${VERSION}"'|' README.md
SED -i -E 's/Version-[0-9]+\.[0-9]+\.[0-9]+-blue/Version-'"${VERSION}"'-blue/' README.md
SED -i -E 's/earth.adi:testcontainers-foundationdb:[0-9]+\.[0-9]+\.[0-9]+/earth.adi:testcontainers-foundationdb:'"${VERSION}"'/' README.md
sed -i -E 's|testcontainers-foundationdb</artifactId>\n <version>[0-9]+\.[0-9]+\.[0-9]+|testcontainers-foundationdb</artifactId>\n <version>'"${VERSION}"'|' README.md

0 comments on commit ef5cf19

Please sign in to comment.