3 export BTR_BINDIR
=$
(dirname $0)/
4 export BTR_LIBDIR
=$
(dirname $0)/..
/share
/btr
5 BTR_BANNER
="Install btr hook into your VCS reporitory."
7 .
$BTR_LIBDIR/common.sh
18 btr_confirm
"Everything setup. Do you want to install the '$BTR_EXTRA_ARGS' hook for '$BTR_SOURCE_RULES'?"
20 case "$BTR_SOURCE_RULES" in
22 case "$BTR_EXTRA_ARGS" in
23 post-commit|post-applypatch|post-merge|post-checkout
)
24 BTR_HOOK_FILE
="${BTR_SOURCE_ARGS:-.}/.git/hooks/$BTR_EXTRA_ARGS"
26 if test -f "$BTR_HOOK_FILE"
28 grep -Esv '^BTR_' "$BTR_HOOK_FILE"
32 echo $
(btr_conf_dump
) 'BTR_BRANCH=$(basename $(git symbolic-ref HEAD))' "'$BTR_BINDIR/btr' -qy &"
33 ) >"$BTR_HOOK_FILE.tmp" && \
34 chmod +x
"$BTR_HOOK_FILE.tmp" && \
35 mv "$BTR_HOOK_FILE.tmp" "$BTR_HOOK_FILE" && \
36 $SAY "Installed into $BTR_HOOK_FILE"
41 error
"Sorry, I don't know how to install the '$BTR_EXTRA_ARGS' for '$BTR_SOURCE_RULES'."