Unverified Commit b36c90d9 authored by Diego Costa R's avatar Diego Costa R Committed by GitHub

feat(autoenv): macOS compatibility, add more dirs (#11724)

parent 62ab5406
......@@ -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,7 +33,7 @@ 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
......@@ -46,7 +50,11 @@ END
return 1
fi
# Load autoenv
if [[ -e $autoenv_dir/activate ]];
source $autoenv_dir/activate
else
source $autoenv_dir/activate.sh
fi
fi
}
[[ $? != 0 ]] && return $?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment