Maint: Added script for incrementing FlexGet version

This commit is contained in:
Winston Astrachan 2020-02-18 12:10:25 -05:00
parent b37a2cce2c
commit f42ab0b3c8

18
scripts/update_version.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
CIRCLECI_CONFIG=".circleci/config.yml"
# Read current version from CircleCI config
current_version=`sed -rn 's/^\s*IMAGE_VERSION: \"([0-9\.]*)\"$/\1/p' $CIRCLECI_CONFIG`
# Prompt user for new version
echo "The current configured version of FlexGet: $current_version"
echo "Enter new version:"
read new_version
# Replace version in CircleCI config
sed -i -r "s/(^\s*IMAGE_VERSION: \")([0-9\.]*)\"$/\1$new_version\"/g" $CIRCLECI_CONFIG
# Commit version update
git add $CIRCLECI_CONFIG
git commit -m "Bump FlexGet to $new_version"