a725b0415f
Closes #31518. Signed-off-by: Chongyu Zhu <i@lembacon.com>
39 lines
1.1 KiB
Ruby
39 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.28.0.tar.gz"
|
|
sha256 "f5e6fbd3d67a8c149f8e332e916329def53459158b9075a6147daff3ae88d3d0"
|
|
head "https://github.com/zsh-users/zsh-completions.git"
|
|
|
|
bottle :unneeded
|
|
|
|
def install
|
|
pkgshare.install Dir["src/_*"]
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
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/"test.zsh").write <<~EOS
|
|
fpath=(#{pkgshare} $fpath)
|
|
autoload _ack
|
|
which _ack
|
|
EOS
|
|
assert_match /^_ack/, shell_output("/bin/zsh test.zsh")
|
|
end
|
|
end
|