aboutsummaryrefslogtreecommitdiff
path: root/share/templater/gitflow/setup
blob: 9aab36b5702e244a20a633f8bfb1f0f930d9d2ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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