Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
gitflow hooks and filters for WordPress theme development
#!/bin/sh
#
# Runs during git flow release start
#
# Positional arguments:
# $1 Version
#
# Return VERSION - When VERSION is returned empty gitflow
# will stop as the version is necessary
#
VERSION=$1
# Implement your script here.
TAGS=`git tag ${VERSION}* -l|wc -l`
if [ "$TAGS" != 0 ]; then
LASTTAG=$(git describe --tags $(git rev-list --tags --max-count=1))
MAJOR=`echo ${LASTTAG} | sed "s/^\([0-9]*\).*/\1/")`
MINOR=`echo ${LASTTAG} | sed "s/[0-9]*\.\([0-9]*\).*/\1/")`
REVISION=`git rev-list $MAJOR.$MINOR --count`
VERSION=$MAJOR.$MINOR.$REVISION
fi
# Return the VERSION
echo ${VERSION}
exit 0
#!/bin/sh
#
# Ran before git flow release start
#
# Positional arguments:
# $1 The version (including the version prefix)
# $2 The origin remote
# $3 The full branch name (including the release prefix)
# $4 The base from which this release is started
#
VERSION=$1
ORIGIN=$2
BRANCH=$3
BASE=$4
# Implement your script here.
ROOTDIR=$(git rev-parse --show-toplevel)
sed -i 's/^Version:.*/Version: '$VERSION'/' $ROOTDIR/style.css
git commit -a -m "Version bump $VERSION"
# To terminate the git-flow action, return a non-zero exit code.
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.