-
Notifications
You must be signed in to change notification settings - Fork 134
/
set_version
executable file
·33 lines (31 loc) · 1.35 KB
/
set_version
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
if [ $# -ne 2 ]
then
SCRIPT_NAME=`basename "$0"`
echo "Usage:"
echo " $SCRIPT_NAME <old-version-number> <new-version-number>"
echo "Example:"
echo " $SCRIPT_NAME 0.0.1 0.0.2-SNAPSHOT"
exit 1
fi
OLD_VERSION=$1
NEW_VERSION=$2
echo "Changing ACHE version from $OLD_VERSION to $NEW_VERSION..."
OS=`uname`
if [[ "$OS" == 'Linux' ]]; then
sed -i "s/version = '$OLD_VERSION'/version = '$NEW_VERSION'/" ache/build.gradle
sed -i "s/ version: $OLD_VERSION/ version: $NEW_VERSION/" conda.recipe/meta.yaml
sed -i "s/ git_tag: $OLD_VERSION/ git_tag: $NEW_VERSION/" conda.recipe/meta.yaml
sed -i "s/version = u'$OLD_VERSION'/version = u'$NEW_VERSION'/" docs/conf.py
sed -i "s/release = u'$OLD_VERSION'/release = u'$NEW_VERSION'/" docs/conf.py
elif [[ "$OS" == 'Darwin' ]]; then
sed -i ".bkp" "s/version = '$OLD_VERSION'/version = '$NEW_VERSION'/" ache/build.gradle
sed -i ".bkp" "s/ version: $OLD_VERSION/ version: $NEW_VERSION/" conda.recipe/meta.yaml
sed -i ".bkp" "s/ git_tag: $OLD_VERSION/ git_tag: $NEW_VERSION/" conda.recipe/meta.yaml
sed -i ".bkp" "s/version = u'$OLD_VERSION'/version = u'$NEW_VERSION'/" docs/conf.py
sed -i ".bkp" "s/release = u'$OLD_VERSION'/release = u'$NEW_VERSION'/" docs/conf.py
rm ache/build.gradle.bkp
rm conda.recipe/meta.yaml.bkp
rm docs/conf.py.bkp
fi
echo "done."