Permalink
Browse files

Make git-flow-version a first-class citizen amongst the other subcomm…

…ands.
1 parent 170dc74 commit 3625f3957f4d559c2851bf8abc91a10d17ffb122 @nvie committed Jan 27, 2010
Showing with 33 additions and 4 deletions.
  1. +6 −1 bump-version
  2. +1 −3 git-flow
  3. +26 −0 git-flow-version
View
7 bump-version
@@ -8,6 +8,11 @@ if [ $# -ne 1 ]; then
exit 1
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 commit -m "Bumped version number to $1" git-flow-version
View
4 git-flow
@@ -33,9 +33,6 @@ has() {
}
usage() {
- . "$GITFLOW_DIR/git-flow-version"
- echo "git-flow, version $GITFLOW_VERSION"
- echo
echo "usage: git flow <subcommand>"
echo
echo "Available subcommands are:"
@@ -44,6 +41,7 @@ usage() {
echo " release Manage your release branches."
echo " hotfix Manage your hotfix branches."
echo " support Manage your support branches."
+ echo " version Shows version information."
echo
echo "Try 'git flow <subcommand> help' for details."
}
View
26 git-flow-version
@@ -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
+
+usage() {
+ echo "usage: git flow version"
+}
+
+cmd_help() {
+ usage
+ exit 0
+}
+
+cmd_default() {
+ echo "$GITFLOW_VERSION"
+}

0 comments on commit 3625f39

Please sign in to comment.