summaryrefslogtreecommitdiffstats
path: root/scripts/bump_hc_version.sh
blob: d1521626c07d43a1bd660338239cca917a3e6b09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# Replaces version string in all files from the Git index
# Usage:
# ./bump_hc_version.sh 1.2.3-SNAPSHOT 1.2.3-RC1

if [ "$#" -ne 2 ]; then
    echo "Usage: ./bump_hc_version.sh OLD_VERSION NEW_VERSION"
    exit 1
fi

OLD_VERSION=$1
NEW_VERSION=$2
BUMP_SCRIPT_FILENAME=$(basename "$0")
GIT_ROOT=$(git rev-parse --show-toplevel)

cd $GIT_ROOT

for i in $(git ls-files); do
  sed -i "s/${OLD_VERSION}/${NEW_VERSION}/g" $i
done

cd -