aboutsummaryrefslogtreecommitdiff
path: root/share/templater/githooks/setup
blob: 84c3f0e752d56fa23350490ce329ccd63df506bc (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
#!/bin/bash
#
# Githooks templater module.
#

# Parameters
SHARE="$1"

# Include basic functions
source $SHARE/templater/functions || exit 1

# Git hooks implementation
function templater_githooks {
  # TODO: check if githooks are already set
  if [ -d ".git" ]; then
    if which git-hooks &> /dev/null; then
      templater_echo "Setting up git-hooks..."
      git hooks --install
    fi
  else
    templater_echo "Git hooks already set"
  fi
}

# Dispatch
templater_githooks