forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash-completion2.rb
40 lines (31 loc) · 1.2 KB
/
bash-completion2.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
34
35
36
37
38
39
40
require 'formula'
class BashCompletion2 < Formula
homepage 'http://bash-completion.alioth.debian.org/'
url 'http://bash-completion.alioth.debian.org/files/bash-completion-2.1.tar.bz2'
sha256 '2b606804a7d5f823380a882e0f7b6c8a37b0e768e72c3d4107c51fbe8a46ae4f'
conflicts_with 'bash-completion'
def compdir
HOMEBREW_PREFIX/'share/bash-completion/completions'
end
def install
inreplace 'bash_completion', 'readlink -f', 'readlink'
system "./configure", "--prefix=#{prefix}", "--sysconfdir=#{etc}"
ENV.deparallelize
system "make install"
unless (compdir/'brew').exist?
compdir.install_symlink HOMEBREW_CONTRIB/'brew_bash_completion.sh' => 'brew'
end
end
def caveats; <<-EOS.undent
Add the following to your ~/.bash_profile:
if [ -f $(brew --prefix)/share/bash-completion/bash_completion ]; then
. $(brew --prefix)/share/bash-completion/bash_completion
fi
Homebrew's own bash completion script has been linked into
#{compdir}
bash-completion will automatically source it when you invoke `brew`.
Any completion scripts in #{Formula.factory("bash-completion").compdir}
will continue to be sourced as well.
EOS
end
end