Skip to content

Commit

Permalink
Added 'init()' function to git-flow-{feature,release,hotfix,support},…
Browse files Browse the repository at this point in the history
… which gets called if subargument is not help
  • Loading branch information
pcragone committed Apr 21, 2012
1 parent ab7fda2 commit dc902ed
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 deletions.
5 changes: 4 additions & 1 deletion git-flow
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 dc902ed

Please sign in to comment.