b7617b35ffd56243fa6d310886d8effe9f27bfc1
- Author
- Jonathan Cremin <jonathan@crem.in>
- Committer
- Jonathan Cremin <jonathan@crem.in>
- Date
Message
Check for autoenv_init function before trying to source autoenv.
Diff
1diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
2index a8271849e3004255b2acb29b6cdefa089e917ddb..edc16a4caba228a919d84c758ae8465579ecc777 100644
3--- a/plugins/autoenv/autoenv.plugin.zsh
4+++ b/plugins/autoenv/autoenv.plugin.zsh
5@@ -1,7 +1,7 @@
6 # Activates autoenv or reports its failure
7-if ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
8+if ! type autoenv_init &>/dev/null && ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
9 echo '-------- AUTOENV ---------'
10- echo 'Could not find ~/.autoenv/activate.sh.'
11+ echo 'Could not find autoenv_init function or ~/.autoenv/activate.sh.'
12 echo 'Please check if autoenv is correctly installed.'
13 echo 'In the meantime the autoenv plugin is DISABLED.'
14 echo '--------------------------'