summaryrefslogtreecommitdiff
path: root/plugins/asdf/asdf.plugin.zsh
diff options
context:
space:
mode:
authorKozlov Alexander <badryke@gmail.com>2018-11-16 13:38:43 +0300
committerGitHub <noreply@github.com>2018-11-16 13:38:43 +0300
commit8c95c52353118643ac3dbd9b0c185a3129b84bf8 (patch)
treeee7497251b7a541480ae5c6a97b63b14381ed5ee /plugins/asdf/asdf.plugin.zsh
parentdd30cf104c9ca42d89d26a134382ca421869ce7e (diff)
parent3d8f2bda599c8c6d160dc448e5ab28aaf2d5e90d (diff)
downloadzsh-8c95c52353118643ac3dbd9b0c185a3129b84bf8.tar.gz
zsh-8c95c52353118643ac3dbd9b0c185a3129b84bf8.tar.bz2
zsh-8c95c52353118643ac3dbd9b0c185a3129b84bf8.zip
Merge branch 'master' into master
Diffstat (limited to 'plugins/asdf/asdf.plugin.zsh')
-rw-r--r--plugins/asdf/asdf.plugin.zsh18
1 files changed, 14 insertions, 4 deletions
diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh
index 8736d2ff8..75395c718 100644
--- a/plugins/asdf/asdf.plugin.zsh
+++ b/plugins/asdf/asdf.plugin.zsh
@@ -1,7 +1,17 @@
-# Find where asdf should be installed.
+# Find where asdf should be installed
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
-# Load asdf, if found.
-if [ -f $ASDF_DIR/asdf.sh ]; then
- . $ASDF_DIR/asdf.sh
+# If not found, check for Homebrew package
+if [[ ! -d $ASDF_DIR ]] && (( $+commands[brew] )); then
+ ASDF_DIR="$(brew --prefix asdf)"
+fi
+
+# Load command
+if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
+ . "$ASDF_DIR/asdf.sh"
+
+ # Load completions
+ if [[ -f "$ASDF_DIR/completions/asdf.bash" ]]; then
+ . "$ASDF_DIR/completions/asdf.bash"
+ fi
fi