Konano/arknights-mower

View on GitHub
.github/gitflow-hooks/pre-flow-hotfix-finish

Summary

Maintainability
Test Coverage
#!/bin/bash
#
# Runs at the end of git flow hotfix start
#
# Positional arguments:
# $1    The version (including the version prefix)
# $2    The origin remote
# $3    The full branch name (including the hotfix prefix)
# $4    The base from which this hotfix is started
#
# The following variables are available as they are exported by git-flow:
#
# MASTER_BRANCH - The branch defined as Master
# DEVELOP_BRANCH - The branch defined as Develop
#
# VERSION=$1
# ORIGIN=$2
# BRANCH=$3
# BASE=$4

ROOT=`git rev-parse --show-toplevel`
VERSION=${1:1}

sed -i "s/__version__ = '[0-9\.a]\+'/__version__ = '$VERSION'/g" "$ROOT/arknights_mower/__init__.py"
git add "$ROOT/arknights_mower/__init__.py"
git commit -m "hotfix: v$VERSION"