homebrew-core/Formula/zsh-completions.rb
akisaarr c6b4733b2e zsh-completions 0.17.0
Closes Homebrew/homebrew#50120.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-16 13:35:46 +08:00

40 lines
1.1 KiB
Ruby

class ZshCompletions < Formula
desc "Additional completion definitions for zsh"
homepage "https://github.com/zsh-users/zsh-completions"
url "https://github.com/zsh-users/zsh-completions/archive/0.17.0.tar.gz"
sha256 "e1797e22e2bbbe50bf61f88db43216c0aef53713c84373bafddf6090b1fe8f68"
head "https://github.com/zsh-users/zsh-completions.git"
bottle :unneeded
def install
(share/"zsh-completions").install Dir["src/_*"]
end
def caveats
<<-EOS.undent
To activate these completions, add the following to your .zshrc:
fpath=(#{HOMEBREW_PREFIX}/share/zsh-completions $fpath)
You may also need to force rebuild `zcompdump`:
rm -f ~/.zcompdump; compinit
Additionally, if you receive "zsh compinit: insecure directories" warnings when attempting
to load these completions, you may need to run this:
chmod go-w '#{HOMEBREW_PREFIX}/share'
EOS
end
test do
(testpath/".zshrc").write <<-EOS.undent
fpath=(#{HOMEBREW_PREFIX}/share/zsh-completions $fpath)
autoload -U compinit
compinit
EOS
system "/bin/zsh", "--login", "-i", "-c", "which _ack"
end
end