From 56a1f26373befae39ded08bb5a4225a60d3d34cd Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Fri, 19 Feb 2016 10:57:15 +0100 Subject: [PATCH] homebrew: Link ZSH completion into plugin function directory --- plugins/homebrew/functions/.gitignore | 1 + plugins/homebrew/homebrew.zprofile | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 plugins/homebrew/functions/.gitignore diff --git a/plugins/homebrew/functions/.gitignore b/plugins/homebrew/functions/.gitignore new file mode 100644 index 0000000..d5e2d21 --- /dev/null +++ b/plugins/homebrew/functions/.gitignore @@ -0,0 +1 @@ +_brew diff --git a/plugins/homebrew/homebrew.zprofile b/plugins/homebrew/homebrew.zprofile index 670a349..476b65d 100644 --- a/plugins/homebrew/homebrew.zprofile +++ b/plugins/homebrew/homebrew.zprofile @@ -6,3 +6,11 @@ [[ -d "/usr/local/share/zsh-completions" ]] \ && axzsh_fpath=(/usr/local/share/zsh-completions $axzsh_fpath) + +completion_file="$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh" +target_file="$(dirname "$0")/functions/_brew" + +[[ -r "$completion_file" && ! -r "$target_file" ]] \ + && ln -fs "$completion_file" "$target_file" + +unset completion_file target_file -- 2.39.2