]> arthur.barton.de Git - ax-zsh.git/commitdiff
homebrew: Link ZSH completion into plugin function directory
authorAlexander Barton <alex@barton.de>
Fri, 19 Feb 2016 09:57:15 +0000 (10:57 +0100)
committerAlexander Barton <alex@barton.de>
Fri, 19 Feb 2016 09:57:15 +0000 (10:57 +0100)
plugins/homebrew/functions/.gitignore [new file with mode: 0644]
plugins/homebrew/homebrew.zprofile

diff --git a/plugins/homebrew/functions/.gitignore b/plugins/homebrew/functions/.gitignore
new file mode 100644 (file)
index 0000000..d5e2d21
--- /dev/null
@@ -0,0 +1 @@
+_brew
index 670a349c6c371fb21fc03df72905e6a8c62b5372..476b65dd3790fdbfcb7a1af210768d487f070257 100644 (file)
@@ -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