summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Cremin <jonathan@crem.in>2015-07-10 14:03:55 +0100
committerJonathan Cremin <jonathan@crem.in>2015-07-10 14:12:27 +0100
commitb7617b35ffd56243fa6d310886d8effe9f27bfc1 (patch)
treeba8f523673762b3eb1385dd83a93448f7e3140e3
parent3ea33841863c4f5f22a27e64ae7950d901b674af (diff)
downloadzsh-b7617b35ffd56243fa6d310886d8effe9f27bfc1.tar.gz
zsh-b7617b35ffd56243fa6d310886d8effe9f27bfc1.tar.bz2
zsh-b7617b35ffd56243fa6d310886d8effe9f27bfc1.zip
Check for autoenv_init function before trying to source autoenv.
-rw-r--r--plugins/autoenv/autoenv.plugin.zsh4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
index a8271849e..edc16a4ca 100644
--- a/plugins/autoenv/autoenv.plugin.zsh
+++ b/plugins/autoenv/autoenv.plugin.zsh
@@ -1,7 +1,7 @@
# Activates autoenv or reports its failure
-if ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
+if ! type autoenv_init &>/dev/null && ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
echo '-------- AUTOENV ---------'
- echo 'Could not find ~/.autoenv/activate.sh.'
+ echo 'Could not find autoenv_init function or ~/.autoenv/activate.sh.'
echo 'Please check if autoenv is correctly installed.'
echo 'In the meantime the autoenv plugin is DISABLED.'
echo '--------------------------'