Skip to content

Commit

Permalink
Merge pull request nvie#211 from pcragone/develop
Browse files Browse the repository at this point in the history
Added 'init()' function to git-flow-{feature,release,hotfix,support}
  • Loading branch information
nvie committed Jul 9, 2012
2 parents c072ff6 + dc902ed commit f414f0c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 deletions.
5 changes: 4 additions & 1 deletion git-flow
Expand Up @@ -109,7 +109,10 @@ main() {
fi

# run the specified action
cmd_$SUBACTION "$@"
if [ $SUBACTION != "help" ]; then
init
fi
cmd_$SUBACTION "$@"
}

main "$@"
10 changes: 6 additions & 4 deletions git-flow-feature
Expand Up @@ -36,10 +36,12 @@
# policies, either expressed or implied, of Vincent Driessen.
#

require_git_repo
require_gitflow_initialized
gitflow_load_settings
PREFIX=$(git config --get gitflow.prefix.feature)
init() {
require_git_repo
require_gitflow_initialized
gitflow_load_settings
PREFIX=$(git config --get gitflow.prefix.feature)
}

usage() {
echo "usage: git flow feature [list] [-v]"
Expand Down
12 changes: 7 additions & 5 deletions git-flow-hotfix
Expand Up @@ -36,11 +36,13 @@
# policies, either expressed or implied, of Vincent Driessen.
#

require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.hotfix)
init() {
require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.hotfix)
}

usage() {
echo "usage: git flow hotfix [list] [-v]"
Expand Down
12 changes: 7 additions & 5 deletions git-flow-release
Expand Up @@ -36,11 +36,13 @@
# policies, either expressed or implied, of Vincent Driessen.
#

require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.release)
init() {
require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.release)
}

usage() {
echo "usage: git flow release [list] [-v]"
Expand Down
12 changes: 7 additions & 5 deletions git-flow-support
Expand Up @@ -36,11 +36,13 @@
# policies, either expressed or implied, of Vincent Driessen.
#

require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.support)
init() {
require_git_repo
require_gitflow_initialized
gitflow_load_settings
VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`")
PREFIX=$(git config --get gitflow.prefix.support)
}

warn "note: The support subcommand is still very EXPERIMENTAL!"
warn "note: DO NOT use it in a production situation."
Expand Down

0 comments on commit f414f0c

Please sign in to comment.