#!/bin/sh # # Runs before 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 here. . "$HOOKS_DIR"/gitflow-functions ROOTDIR=$(git rev-parse --show-toplevel) AUTHORS=$(mktemp --suffix=.gitflow) # Create an up to date AUTHORS file echo "git-flow AVH Authors This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history (Changes.mdown) and logs, available at http://github.com/petervanderdoes/gitflow. " > $AUTHORS git shortlog -ns --no-merges | cut -f2 >> $AUTHORS echo " Portions of the project are derived from other open source works are clearly marked. This file is auto generated, any changes will be lost." >> $AUTHORS # Check if the new file is different # If it's not there is no need to copy it and commit diff $AUTHORS $ROOTDIR/AUTHORS > /dev/null 2>&1 DIFF=$? if [ $DIFF -ne 0 ]; then cp $AUTHORS $ROOTDIR/AUTHORS git commit -a -m "Update of the contributers." fi #Update the version number and commit. gitflow_update_version $VERSION # Clean up rm $AUTHORS # To terminate the git-flow action, return a non-zero exit code. exit 0