File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
pet-global-virtualenvs/src Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,20 @@ fn get_global_virtualenv_dirs(
5656}
5757
5858pub fn list_global_virtual_envs_paths (
59+ virtual_env_env_var : Option < String > ,
5960 work_on_home_env_var : Option < String > ,
6061 xdg_data_home : Option < String > ,
6162 user_home : Option < PathBuf > ,
6263) -> Vec < PathBuf > {
6364 let mut python_envs: Vec < PathBuf > = vec ! [ ] ;
65+
66+ if let Some ( virtual_env) = virtual_env_env_var {
67+ let virtual_env = norm_case ( expand_path ( PathBuf :: from ( virtual_env) ) ) ;
68+ if virtual_env. exists ( ) {
69+ python_envs. push ( virtual_env) ;
70+ }
71+ }
72+
6473 for root_dir in & get_global_virtualenv_dirs ( work_on_home_env_var, xdg_data_home, user_home) {
6574 if let Ok ( dirs) = fs:: read_dir ( root_dir) {
6675 python_envs. append (
Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ pub fn find_and_report_envs(
160160
161161 let search_paths: Vec < PathBuf > = [
162162 list_global_virtual_envs_paths (
163+ environment. get_env_var ( "VIRTUAL_ENV" . into ( ) ) ,
163164 environment. get_env_var ( "WORKON_HOME" . into ( ) ) ,
164165 environment. get_env_var ( "XDG_DATA_HOME" . into ( ) ) ,
165166 environment. get_user_home ( ) ,
You can’t perform that action at this time.
0 commit comments