Skip to content
This repository
Browse code

Merge pull request #211 from pcragone/develop

Added 'init()' function to git-flow-{feature,release,hotfix,support}
  • Loading branch information...
commit f414f0cab6573e1ac54d489af20327c1c91094e7 2 parents c072ff6 + dc902ed
Vincent Driessen authored
5 git-flow
@@ -109,7 +109,10 @@ main() {
109 109 fi
110 110
111 111 # run the specified action
112   - cmd_$SUBACTION "$@"
  112 + if [ $SUBACTION != "help" ]; then
  113 + init
  114 + fi
  115 + cmd_$SUBACTION "$@"
113 116 }
114 117
115 118 main "$@"
10 git-flow-feature
@@ -36,10 +36,12 @@
36 36 # policies, either expressed or implied, of Vincent Driessen.
37 37 #
38 38
39   -require_git_repo
40   -require_gitflow_initialized
41   -gitflow_load_settings
42   -PREFIX=$(git config --get gitflow.prefix.feature)
  39 +init() {
  40 + require_git_repo
  41 + require_gitflow_initialized
  42 + gitflow_load_settings
  43 + PREFIX=$(git config --get gitflow.prefix.feature)
  44 +}
43 45
44 46 usage() {
45 47 echo "usage: git flow feature [list] [-v]"
12 git-flow-hotfix
@@ -36,11 +36,13 @@
36 36 # policies, either expressed or implied, of Vincent Driessen.
37 37 #
38 38
39   -require_git_repo
40   -require_gitflow_initialized
41   -gitflow_load_settings
42   -VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
43   -PREFIX=$(git config --get gitflow.prefix.hotfix)
  39 +init() {
  40 + require_git_repo
  41 + require_gitflow_initialized
  42 + gitflow_load_settings
  43 + VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
  44 + PREFIX=$(git config --get gitflow.prefix.hotfix)
  45 +}
44 46
45 47 usage() {
46 48 echo "usage: git flow hotfix [list] [-v]"
12 git-flow-release
@@ -36,11 +36,13 @@
36 36 # policies, either expressed or implied, of Vincent Driessen.
37 37 #
38 38
39   -require_git_repo
40   -require_gitflow_initialized
41   -gitflow_load_settings
42   -VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
43   -PREFIX=$(git config --get gitflow.prefix.release)
  39 +init() {
  40 + require_git_repo
  41 + require_gitflow_initialized
  42 + gitflow_load_settings
  43 + VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
  44 + PREFIX=$(git config --get gitflow.prefix.release)
  45 +}
44 46
45 47 usage() {
46 48 echo "usage: git flow release [list] [-v]"
12 git-flow-support
@@ -36,11 +36,13 @@
36 36 # policies, either expressed or implied, of Vincent Driessen.
37 37 #
38 38
39   -require_git_repo
40   -require_gitflow_initialized
41   -gitflow_load_settings
42   -VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
43   -PREFIX=$(git config --get gitflow.prefix.support)
  39 +init() {
  40 + require_git_repo
  41 + require_gitflow_initialized
  42 + gitflow_load_settings
  43 + VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
  44 + PREFIX=$(git config --get gitflow.prefix.support)
  45 +}
44 46
45 47 warn "note: The support subcommand is still very EXPERIMENTAL!"
46 48 warn "note: DO NOT use it in a production situation."

0 comments on commit f414f0c

Fred Condo

This line causes an error message when doing, for example, "git flow init -fd": "line 113: init: command not found"

Peter van der Does

Line 112 should read:
if [ $SUBACTION != "help" ] && [ $SUBCOMMAND != "init" ] ; then

As the init command does not have the init function, nor does it need one.

Fred Condo

Thanks!

Please sign in to comment.
Something went wrong with that request. Please try again.