-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.git-hooks
More file actions
31 lines (21 loc) · 715 Bytes
/
.git-hooks
File metadata and controls
31 lines (21 loc) · 715 Bytes
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
#!/usr/bin/env bash
echo "BEGIN Git hook: ${sghHookName}"
function sghExit ()
{
echo "END Git hook: ${sghHookName}"
exit $1
}
export COMPOSER_DISABLE_XDEBUG_WARN=1
# @todo Better detection for executables: php, composer.phar.
sghRobo="$(composer config 'bin-dir')/robo"
test -s "${sghBridge}-local" && . "${sghBridge}-local"
sghTask="githook:${sghHookName}"
# Exit without error if "robo" doesn't exists or it has no corresponding task.
test -x "$sghRobo" || sghExit 0
"${sghRobo}" help "${sghTask}" 1> /dev/null 2>&1 || sghExit 0
if [ "$sghHasInput" = 'true' ]; then
"$sghRobo" "${sghTask}" $@ <<< $(</dev/stdin) || sghExit $?
else
"$sghRobo" "${sghTask}" $@ || sghExit $?
fi
sghExit 0