Last active
October 26, 2023 14:28
-
-
Save anton-x-t/a5bb770ab18e5f32a4d2877c0e9edbae to your computer and use it in GitHub Desktop.
gradle_properties_bump_minor_version.sh
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
#!/bin/bash | |
# Copyright 2023 Anton Thelander | |
# License: MIT | |
gradle_properties_file=gradle.properties | |
original_complete_row=$(grep -E "version=.+\..+\..+" $gradle_properties_file) | |
before_minor_v=$(echo $original_complete_row | cut -f1 -d".") | |
original_minor_v=$(echo $original_complete_row | cut -f2 -d".") | |
after_minor_v=$(echo $original_complete_row | cut -f3 -d".") | |
bumped_minor_v=$((original_minor_v+1)) | |
bumped_complete_row=$before_minor_v.$bumped_minor_v.$after_minor_v | |
echo original: $original_complete_row | |
echo bumped: $bumped_complete_row | |
sed -i "s/$original_complete_row/$bumped_complete_row/g" "$gradle_properties_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment