diff --git a/scripts/update_version.sh b/scripts/update_version.sh new file mode 100755 index 0000000..323b94a --- /dev/null +++ b/scripts/update_version.sh @@ -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"