forked from petervanderdoes/git-flow-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post-flow-release-finish
executable file
·38 lines (31 loc) · 1007 Bytes
/
post-flow-release-finish
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
34
35
36
37
38
#!/bin/sh
#
# Runs at the end of git flow release finish
#
# Positional arguments:
# $1 The version (including the version prefix)
# $2 The origin remote
# $3 The full branch name (including the release prefix)
#
VERSION=$1
ORIGIN=$2
BRANCH=$3
# Implement your script aere.
. "$HOOKS_DIR"/gitflow-functions
ROOTDIR=$(git rev-parse --show-toplevel)
git checkout $DEVELOP_BRANCH
TMPFILE=$(mktemp --suffix=.gitflow)
gitflow_set_major_minor $VERSION
AVH_MINOR=$(($AVH_MINOR+1))
AVH_PATCH_LEVEL=0
gitflow_set_dev_release
gitflow_build_version
LINENUMBER=$(($(grep -m1 -n "^#### " $ROOTDIR/Changes.mdown | cut -f1 -d:) -1 ))
sed ''$LINENUMBER'a#### '$AVH_VERSION' =\n* Preparation for new development cycle.\n' $ROOTDIR/Changes.mdown > $TMPFILE
cp $TMPFILE $ROOTDIR/Changes.mdown
gitflow_update_version $AVH_VERSION "Preparation for new development cycle after release $VERSION"
git checkout $BRANCH
#Clean up
rm -f $TMPFILE
# To terminate the git-flow action, return a non-zero exit code.
exit 0