forked from mzp/Git-Hooks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgit-hooks.rb
33 lines (25 loc) · 1019 Bytes
/
git-hooks.rb
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
32
33
require 'formula'
class GitHooks < Formula
head 'https://github.com/mistilteinn/git-hooks.git', :branch => 'rewrite'
homepage 'https://github.com/mistilteinn'
def install
system "perl", "Install.PL", "-v", "linux", "--prefix=" + prefix
bin.install "commands/git-hooks"
(prefix + "etc/zsh_completion.d").install "git-hooks-completion.zsh"
end
def caveats
<<-EOL.undent
If you have installed git-hooks, you can use settings below.
You must set envirnment variable GIT_HOOKS_HOME to your startup script(like .bashrc).
# BEGIN example. (write into $HOME/.bashrc if use bash)
GIT_HOOKS_HOME=/usr/local/share/git-core/Git-Hooks; export GIT_HOOKS_HOME
# END
If you use zsh and want to completion git hooks, write below setting in .zshrc
# BEGIN use git hooks completion
source /usr/local/etc/zsh_completion.d/git-hooks-completion.zsh
# END
and run below
$ git config --global alias.hooks hooks
EOL
end
end