-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.git-hooks
More file actions
29 lines (20 loc) · 711 Bytes
/
Copy path.git-hooks
File metadata and controls
29 lines (20 loc) · 711 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
#!/usr/bin/env bash
echo "BEGIN Git hook: ${sghHookName}"
function myExit ()
{
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"
# Exit without error if "robo" doesn't exists or it has no corresponding task.
test -x "$sghRobo" || myExit 0
"${sghRobo}" help "githook:${sghHookName}" 1> /dev/null 2>&1 || myExit 0
if [ "$sghHasInput" = 'true' ]; then
"$sghRobo" "githook:${sghHookName}" $@ <<< $(</dev/stdin) || myExit $?
else
"$sghRobo" "githook:${sghHookName}" $@ || myExit $?
fi
myExit 0