mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
feat(autoenv): macOS compatibility, add more dirs (#11724)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
parent
62ab5406dd
commit
b36c90d9ab
1 changed files with 12 additions and 4 deletions
|
@ -17,9 +17,13 @@ if ! type autoenv_init >/dev/null; then
|
||||||
/usr/local/bin
|
/usr/local/bin
|
||||||
/usr/share/autoenv-git
|
/usr/share/autoenv-git
|
||||||
~/Library/Python/bin
|
~/Library/Python/bin
|
||||||
|
.venv/bin
|
||||||
|
venv/bin
|
||||||
|
env/bin
|
||||||
|
.env/bin
|
||||||
)
|
)
|
||||||
for d ( $install_locations ); do
|
for d ( $install_locations ); do
|
||||||
if [[ -e $d/activate.sh ]]; then
|
if [[ -e $d/activate || -e $d/activate.sh ]]; then
|
||||||
autoenv_dir=$d
|
autoenv_dir=$d
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
@ -29,7 +33,7 @@ if ! type autoenv_init >/dev/null; then
|
||||||
# Look for Homebrew path as a last resort
|
# Look for Homebrew path as a last resort
|
||||||
if [[ -z "$autoenv_dir" ]] && (( $+commands[brew] )); then
|
if [[ -z "$autoenv_dir" ]] && (( $+commands[brew] )); then
|
||||||
d=$(brew --prefix)/opt/autoenv
|
d=$(brew --prefix)/opt/autoenv
|
||||||
if [[ -e $d/activate.sh ]]; then
|
if [[ -e $d/activate || -e $d/activate.sh ]]; then
|
||||||
autoenv_dir=$d
|
autoenv_dir=$d
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -46,8 +50,12 @@ END
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
# Load autoenv
|
# Load autoenv
|
||||||
|
if [[ -e $autoenv_dir/activate ]];
|
||||||
|
source $autoenv_dir/activate
|
||||||
|
else
|
||||||
source $autoenv_dir/activate.sh
|
source $autoenv_dir/activate.sh
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
[[ $? != 0 ]] && return $?
|
[[ $? != 0 ]] && return $?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue