aboutsummaryrefslogtreecommitdiff
path: root/share/templater/gitflow/setup
diff options
context:
space:
mode:
Diffstat (limited to 'share/templater/gitflow/setup')
-rwxr-xr-xshare/templater/gitflow/setup32
1 files changed, 32 insertions, 0 deletions
diff --git a/share/templater/gitflow/setup b/share/templater/gitflow/setup
new file mode 100755
index 0000000..5f0eff7
--- /dev/null
+++ b/share/templater/gitflow/setup
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# Gitflow templater module.
+#
+
+# Parameters
+SHARE="$1"
+
+# Include basic functions
+source $SHARE/templater/functions || exit 1
+
+# Setup git-flow implementation
+function templater_gitflow {
+ if ! grep -q '^\[gitflow' .git/config; then
+ if ! git branch --list develop | grep -q develop; then
+ __templater_echo "Setting up git-flow..."
+
+ git branch develop
+
+ if [ -e "/usr/lib/git-core/git-flow" ]; then
+ echo ""
+ __templater_echo "Setting up git-flow..."
+ git flow init -d
+ fi
+ fi
+ else
+ __templater_echo "Git flow already set"
+ fi
+}
+
+# Dispatch
+templater_gitflow