summaryrefslogtreecommitdiff
path: root/plugins/autoenv/autoenv.plugin.zsh
diff options
context:
space:
mode:
authorAshley Valent <avalent@atlassian.com>2015-02-11 11:22:15 +1100
committerAshley Valent <avalent@atlassian.com>2015-02-11 11:22:15 +1100
commit3b6a695b60d81691ab8e31197fc8e0444df0e394 (patch)
tree84529e1bc0a54cdd9471e53c597e913797c04014 /plugins/autoenv/autoenv.plugin.zsh
parent3ba10ad0a2ed85c26e096126a7899a401cf8f9e7 (diff)
parentef7e53a78d0e4196c2d1e6e5b268209759d51753 (diff)
downloadzsh-3b6a695b60d81691ab8e31197fc8e0444df0e394.tar.gz
zsh-3b6a695b60d81691ab8e31197fc8e0444df0e394.tar.bz2
zsh-3b6a695b60d81691ab8e31197fc8e0444df0e394.zip
Merge branch 'master' of github.com:avalent/oh-my-zsh
Diffstat (limited to 'plugins/autoenv/autoenv.plugin.zsh')
-rw-r--r--plugins/autoenv/autoenv.plugin.zsh11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
index ca5666979..a8271849e 100644
--- a/plugins/autoenv/autoenv.plugin.zsh
+++ b/plugins/autoenv/autoenv.plugin.zsh
@@ -1,6 +1,17 @@
+# Activates autoenv or reports its failure
+if ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
+ echo '-------- AUTOENV ---------'
+ echo 'Could not find ~/.autoenv/activate.sh.'
+ echo 'Please check if autoenv is correctly installed.'
+ echo 'In the meantime the autoenv plugin is DISABLED.'
+ echo '--------------------------'
+ return 1
+fi
+
# The use_env call below is a reusable command to activate/create a new Python
# virtualenv, requiring only a single declarative line of code in your .env files.
# It only performs an action if the requested virtualenv is not the current one.
+
use_env() {
typeset venv
venv="$1"