浏览代码

Check for autoenv_init function before trying to source autoenv.

Jonathan Cremin 9 年之前
父节点
当前提交
b7617b35ff
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins/autoenv/autoenv.plugin.zsh

+ 2 - 2
plugins/autoenv/autoenv.plugin.zsh

@@ -1,7 +1,7 @@
 # Activates autoenv or reports its failure
 # 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 '-------- 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 'Please check if autoenv is correctly installed.'
   echo 'In the meantime the autoenv plugin is DISABLED.'
   echo 'In the meantime the autoenv plugin is DISABLED.'
   echo '--------------------------'
   echo '--------------------------'