From b36c90d9abd2fd2ffe53d19b11e47077dfdb38a8 Mon Sep 17 00:00:00 2001 From: Diego Costa R <62116423+diegocostares@users.noreply.github.com> Date: Mon, 5 Jun 2023 04:25:17 -0400 Subject: feat(autoenv): macOS compatibility, add more dirs (#11724) Co-authored-by: Carlo Sala --- plugins/autoenv/autoenv.plugin.zsh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'plugins/autoenv') diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh index 229a8a834..cbf7cefbb 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 <&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 ]]; + source $autoenv_dir/activate + else + source $autoenv_dir/activate.sh + fi fi } [[ $? != 0 ]] && return $? -- cgit v1.2.3-70-g09d2 From d1c64bfda30ad56bac09f11c920b93b94dab7f9f Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 5 Jun 2023 10:26:36 +0200 Subject: fix(autoenv): typo --- plugins/autoenv/autoenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/autoenv') diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh index cbf7cefbb..2f84f0acf 100644 --- a/plugins/autoenv/autoenv.plugin.zsh +++ b/plugins/autoenv/autoenv.plugin.zsh @@ -50,7 +50,7 @@ END return 1 fi # Load autoenv - if [[ -e $autoenv_dir/activate ]]; + if [[ -e $autoenv_dir/activate ]]; then source $autoenv_dir/activate else source $autoenv_dir/activate.sh -- cgit v1.2.3-70-g09d2