Make git-flow-version a first-class citizen amongst the other subcommands.
This commit is contained in:
parent
170dc747e2
commit
3625f3957f
3 changed files with 33 additions and 4 deletions
|
@ -8,6 +8,11 @@ if [ $# -ne 1 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "GITFLOW_VERSION=$1" > git-flow-version
|
if ! sed 's/^GITFLOW_VERSION=.*$/GITFLOW_VERSION='$1'/g' git-flow-version > .git-flow-version.new; then
|
||||||
|
echo "Could not replace GITFLOW_VERSION variable." >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv .git-flow-version.new git-flow-version
|
||||||
git add git-flow-version
|
git add git-flow-version
|
||||||
git commit -m "Bumped version number to $1" git-flow-version
|
git commit -m "Bumped version number to $1" git-flow-version
|
||||||
|
|
4
git-flow
4
git-flow
|
@ -33,9 +33,6 @@ has() {
|
||||||
}
|
}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
. "$GITFLOW_DIR/git-flow-version"
|
|
||||||
echo "git-flow, version $GITFLOW_VERSION"
|
|
||||||
echo
|
|
||||||
echo "usage: git flow <subcommand>"
|
echo "usage: git flow <subcommand>"
|
||||||
echo
|
echo
|
||||||
echo "Available subcommands are:"
|
echo "Available subcommands are:"
|
||||||
|
@ -44,6 +41,7 @@ usage() {
|
||||||
echo " release Manage your release branches."
|
echo " release Manage your release branches."
|
||||||
echo " hotfix Manage your hotfix branches."
|
echo " hotfix Manage your hotfix branches."
|
||||||
echo " support Manage your support branches."
|
echo " support Manage your support branches."
|
||||||
|
echo " version Shows version information."
|
||||||
echo
|
echo
|
||||||
echo "Try 'git flow <subcommand> help' for details."
|
echo "Try 'git flow <subcommand> help' for details."
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,27 @@
|
||||||
|
#
|
||||||
|
# git-flow -- A collection of Git extensions to provide high-level
|
||||||
|
# repository operations for Vincent Driessen's branching model.
|
||||||
|
#
|
||||||
|
# Original blog post presenting this model is found at:
|
||||||
|
# http://nvie.com/archives/323
|
||||||
|
#
|
||||||
|
# Feel free to contribute to this project at:
|
||||||
|
# http://github.com/nvie/gitflow
|
||||||
|
#
|
||||||
|
# Copyright (c) 2010 by Vincent Driessen
|
||||||
|
# Copyright (c) 2010 by Benedikt Böhm
|
||||||
|
#
|
||||||
GITFLOW_VERSION=0.2-dirty
|
GITFLOW_VERSION=0.2-dirty
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "usage: git flow version"
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd_help() {
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd_default() {
|
||||||
|
echo "$GITFLOW_VERSION"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue