summaryrefslogtreecommitdiff
path: root/plugins/autoenv/autoenv.plugin.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2023-11-04 18:38:46 -0700
committerTuowen Zhao <ztuowen@gmail.com>2023-11-04 18:38:46 -0700
commit4d908094fdc2a0c0e9a0a072eba213fab7adef43 (patch)
tree7c17e70bcdeebbe96c84d849bdf17882007480d8 /plugins/autoenv/autoenv.plugin.zsh
parent4b0bbc0b263a150eb9a9b59f196914629be06a9b (diff)
parent632ed413a9ce62747ded83d7736491b081be4b49 (diff)
downloadzsh-master.tar.gz
zsh-master.tar.bz2
zsh-master.zip
Merge remote-tracking branch 'github/master'HEADmaster
Diffstat (limited to 'plugins/autoenv/autoenv.plugin.zsh')
-rw-r--r--plugins/autoenv/autoenv.plugin.zsh16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
index 229a8a834..2f84f0acf 100644
--- a/plugins/autoenv/autoenv.plugin.zsh
+++ b/plugins/autoenv/autoenv.plugin.zsh
@@ -17,9 +17,13 @@ if ! type autoenv_init >/dev/null; then
/usr/local/bin
/usr/share/autoenv-git
~/Library/Python/bin
+ .venv/bin
+ venv/bin
+ env/bin
+ .env/bin
)
for d ( $install_locations ); do
- if [[ -e $d/activate.sh ]]; then
+ if [[ -e $d/activate || -e $d/activate.sh ]]; then
autoenv_dir=$d
break
fi
@@ -29,13 +33,13 @@ if ! type autoenv_init >/dev/null; then
# Look for Homebrew path as a last resort
if [[ -z "$autoenv_dir" ]] && (( $+commands[brew] )); then
d=$(brew --prefix)/opt/autoenv
- if [[ -e $d/activate.sh ]]; then
+ if [[ -e $d/activate || -e $d/activate.sh ]]; then
autoenv_dir=$d
fi
fi
# Complain if autoenv is not installed
- if [[ -z $autoenv_dir ]]; then
+ if [[ -z $autoenv_dir ]]; then
cat <<END >&2
-------- AUTOENV ---------
Could not locate autoenv installation.
@@ -46,7 +50,11 @@ END
return 1
fi
# Load autoenv
- source $autoenv_dir/activate.sh
+ if [[ -e $autoenv_dir/activate ]]; then
+ source $autoenv_dir/activate
+ else
+ source $autoenv_dir/activate.sh
+ fi
fi
}
[[ $? != 0 ]] && return $?