Merge pull request #211 from pcragone/develop
Added 'init()' function to git-flow-{feature,release,hotfix,support}
diff --git a/git-flow b/git-flow
index 93e9f0f..19c337e 100755
--- a/git-flow
+++ b/git-flow
@@ -109,7 +109,10 @@
fi
# run the specified action
- cmd_$SUBACTION "$@"
+ if [ $SUBACTION != "help" ]; then
+ init
+ fi
+ cmd_$SUBACTION "$@"
}
main "$@"
diff --git a/git-flow-feature b/git-flow-feature
index eea2b6a..074081f 100644
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -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]"
diff --git a/git-flow-hotfix b/git-flow-hotfix
index c37be77..8c4ca10 100644
--- a/git-flow-hotfix
+++ b/git-flow-hotfix
@@ -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]"
diff --git a/git-flow-release b/git-flow-release
index 38d93b1..4a43c8e 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -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]"
diff --git a/git-flow-support b/git-flow-support
index 605694d..ba4d92f 100644
--- a/git-flow-support
+++ b/git-flow-support
@@ -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."