-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f171c33
commit 1375889
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# args | ||
NEW_VERSION=$1 | ||
|
||
|
||
POM_FILES=( | ||
"./core/chaintest-core-java/pom.xml" | ||
"./plugins/chaintest-cucumber-jvm/pom.xml" | ||
"./plugins/chaintest-junit5/pom.xml" | ||
"./plugins/chaintest-testng/pom.xml" | ||
"./examples/chaintest-cucumber-jvm-example/pom.xml" | ||
"./examples/chaintest-junit5-example/pom.xml" | ||
"./examples/chaintest-testng-example/pom.xml" | ||
) | ||
|
||
update_versions() { | ||
local new_version=$1 | ||
if [ -z "$new_version" ]; then | ||
echo "No version provided to update." | ||
exit 1 | ||
fi | ||
|
||
for POM_FILE in "${POM_FILES[@]}"; do | ||
sed -i '' "1,/<version>[^<]*<\/version>/s/<version>[^<]*<\/version>/<version>$new_version<\/version>/" "$POM_FILE" | ||
echo "Updated version to $new_version in $POM_FILE" | ||
done | ||
} | ||
|
||
update_versions $NEW_VERSION |