Skip to content

Commit 3625f39

Browse files
committed
Make git-flow-version a first-class citizen amongst the other subcommands.
1 parent 170dc74 commit 3625f39

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

bump-version

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ if [ $# -ne 1 ]; then
88
exit 1
99
fi
1010

11-
echo "GITFLOW_VERSION=$1" > git-flow-version
11+
if ! sed 's/^GITFLOW_VERSION=.*$/GITFLOW_VERSION='$1'/g' git-flow-version > .git-flow-version.new; then
12+
echo "Could not replace GITFLOW_VERSION variable." >&2
13+
exit 2
14+
fi
15+
16+
mv .git-flow-version.new git-flow-version
1217
git add git-flow-version
1318
git commit -m "Bumped version number to $1" git-flow-version

git-flow

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ has() {
3333
}
3434

3535
usage() {
36-
. "$GITFLOW_DIR/git-flow-version"
37-
echo "git-flow, version $GITFLOW_VERSION"
38-
echo
3936
echo "usage: git flow <subcommand>"
4037
echo
4138
echo "Available subcommands are:"
@@ -44,6 +41,7 @@ usage() {
4441
echo " release Manage your release branches."
4542
echo " hotfix Manage your hotfix branches."
4643
echo " support Manage your support branches."
44+
echo " version Shows version information."
4745
echo
4846
echo "Try 'git flow <subcommand> help' for details."
4947
}

git-flow-version

+26
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1+
#
2+
# git-flow -- A collection of Git extensions to provide high-level
3+
# repository operations for Vincent Driessen's branching model.
4+
#
5+
# Original blog post presenting this model is found at:
6+
# http://nvie.com/archives/323
7+
#
8+
# Feel free to contribute to this project at:
9+
# http://github.com/nvie/gitflow
10+
#
11+
# Copyright (c) 2010 by Vincent Driessen
12+
# Copyright (c) 2010 by Benedikt Böhm
13+
#
114
GITFLOW_VERSION=0.2-dirty
15+
16+
usage() {
17+
echo "usage: git flow version"
18+
}
19+
20+
cmd_help() {
21+
usage
22+
exit 0
23+
}
24+
25+
cmd_default() {
26+
echo "$GITFLOW_VERSION"
27+
}

0 commit comments

Comments
 (0)