aboutsummaryrefslogtreecommitdiff
path: root/share/templater/gitflow
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-10-31 17:23:15 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-10-31 17:23:15 -0200
commit82e6bce4ea8fc61e99f6eb32dc12c470b93dccd4 (patch)
tree4b81210f80e8a3e85a1d65b01beb67f92a727066 /share/templater/gitflow
parent8e83eb20f8841022cf9a221f2e8447cdba1f7270 (diff)
downloadtemplater-82e6bce4ea8fc61e99f6eb32dc12c470b93dccd4.tar.gz
templater-82e6bce4ea8fc61e99f6eb32dc12c470b93dccd4.tar.bz2
New module format
Diffstat (limited to 'share/templater/gitflow')
-rw-r--r--share/templater/gitflow/description1
-rwxr-xr-xshare/templater/gitflow/setup32
2 files changed, 33 insertions, 0 deletions
diff --git a/share/templater/gitflow/description b/share/templater/gitflow/description
new file mode 100644
index 0000000..0e13834
--- /dev/null
+++ b/share/templater/gitflow/description
@@ -0,0 +1 @@
+Gitflow branches and configuration
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