Fix syntax errors
[gitolite-hooks.git] / post-receive
1 #!/bin/bash
2 HOOKDIR=$(dirname $0)
3
4 # Load functions
5 . $HOOKDIR/irker
6 . $HOOKDIR/slack
7 . $HOOKDIR/discord
8
9
10 channels=$(git config --get irker.channels)
11
12 slack_url=$(git config --get hooks.slack.webhook-url)
13
14 discord_url=$(git config --get hooks.discord.webhook-url)
15
16 while read line; do
17     set -- $line
18     if [ -n "$channels" ]; then
19         notify_irker $*
20      fi
21      if [ -n "$slack_url" ]; then
22         notify_slack $*
23      fi
24      if [ -n "$discord_url" ]; then
25         notify_discord $*
26      fi
27      RET=$?
28 done
29 exit $RET