forked from petervanderdoes/git-flow-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks_config
More file actions
23 lines (22 loc) · 952 Bytes
/
Copy pathhooks_config
File metadata and controls
23 lines (22 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
MAINFILE=Changes.mdown
_update_version() {
#Update the version number
if [[ -e $ROOTDIR/git-flow-version ]]; then
sed -i 's/^GITFLOW_VERSION=.*/GITFLOW_VERSION='$1'/' $ROOTDIR/git-flow-version;
fi;
if [[ -e $ROOTDIR/Changes.mdown ]]; then
sed -i '0,/####.*/s/^####.*/#### '$1'/' $ROOTDIR/Changes.mdown;
fi;
if [[ -e $ROOTDIR/composer.json ]]; then
sed -i 's/"version": ".*"/"version": "'$1'"/' $ROOTDIR/composer.json;
fi;
if [[ -e $ROOTDIR/index.php ]]; then
sed -i 's/"\([A-Z]\)\+_VERSION",\s*".*"/\1_VERSION", "'$1'"/' $ROOTDIR/index.php;
fi;
if [[ -e $ROOTDIR/.env ]]; then
sed -i 's/\([A-Z]\+\)_VERSION=".*"/\1_VERSION="'$1'"/' $ROOTDIR/.env;
fi;
if [[ -e $ROOTDIR/.env.example ]]; then
sed -i 's/\([A-Z]\+\)_VERSION=".*"/\1_VERSION="'$1'"/' $ROOTDIR/.env.example;
fi;
}