bump_hc_version.sh revision 61017bc6
1#!/bin/bash
2
3# Replaces version string in all files from the Git index
4# Usage:
5# ./bump_hc_version.sh 1.2.3-SNAPSHOT 1.2.3-RC1
6
7if [ "$#" -ne 2 ]; then
8    echo "Usage: ./bump_hc_version.sh OLD_VERSION NEW_VERSION"
9    exit 1
10fi
11
12OLD_VERSION=$1
13NEW_VERSION=$2
14BUMP_SCRIPT_FILENAME=$(basename "$0")
15GIT_ROOT=$(git rev-parse --show-toplevel)
16
17cd $GIT_ROOT
18
19for i in $(git ls-files); do
20  sed -i "s/${OLD_VERSION}/${NEW_VERSION}/g" $i
21done
22
23cd -
24