@@ -10,6 +10,7 @@ use pet_core::os_environment::Environment;
1010use pet_core:: python_environment:: PythonEnvironmentKind ;
1111use pet_core:: Locator ;
1212use pet_core:: { os_environment:: EnvironmentApi , reporter:: Reporter , Configuration } ;
13+ use pet_fs:: glob:: expand_glob_patterns;
1314use pet_poetry:: Poetry ;
1415use pet_poetry:: PoetryLocator ;
1516use pet_python_utils:: cache:: set_cache_directory;
@@ -138,8 +139,8 @@ fn create_config(options: &FindOptions) -> Configuration {
138139 let mut config = Configuration :: default ( ) ;
139140
140141 let mut search_paths = vec ! [ ] ;
141- if let Some ( dirs) = options. search_paths . clone ( ) {
142- search_paths. extend ( dirs) ;
142+ if let Some ( dirs) = options. search_paths . as_ref ( ) {
143+ search_paths. extend ( expand_glob_patterns ( dirs) ) ;
143144 }
144145 // If workspace folders have been provided do not add cwd.
145146 if search_paths. is_empty ( ) {
@@ -168,10 +169,12 @@ fn create_config(options: &FindOptions) -> Configuration {
168169 config. conda_executable = options. conda_executable . clone ( ) ;
169170 config. pipenv_executable = options. pipenv_executable . clone ( ) ;
170171 config. poetry_executable = options. poetry_executable . clone ( ) ;
171- config. environment_directories = options
172- . environment_directories
173- . clone ( )
174- . map ( |dirs| dirs. into_iter ( ) . filter ( |p| p. is_dir ( ) ) . collect ( ) ) ;
172+ config. environment_directories = options. environment_directories . as_ref ( ) . map ( |dirs| {
173+ expand_glob_patterns ( dirs)
174+ . into_iter ( )
175+ . filter ( |p| p. is_dir ( ) )
176+ . collect ( )
177+ } ) ;
175178
176179 config
177180}
0 commit comments