File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,23 @@ fn bundle_crate(crate_name: &str, workspace_path: &Path) -> Result<String> {
171171}
172172
173173fn collect_crates ( libs_path : & Path , crates : & mut HashMap < String , CrateInfo > ) -> Result < ( ) > {
174- for entry in fs:: read_dir ( libs_path) ? {
174+ if !libs_path. exists ( ) {
175+ anyhow:: bail!(
176+ "Libraries directory '{}' does not exist. Please check your workspace path." ,
177+ libs_path. display( )
178+ ) ;
179+ }
180+
181+ if !libs_path. is_dir ( ) {
182+ anyhow:: bail!(
183+ "'{}' is not a directory. Expected a directory containing crate libraries." ,
184+ libs_path. display( )
185+ ) ;
186+ }
187+
188+ for entry in fs:: read_dir ( libs_path)
189+ . with_context ( || format ! ( "Failed to read directory '{}'" , libs_path. display( ) ) ) ?
190+ {
175191 let entry = entry?;
176192 if entry. file_type ( ) ?. is_dir ( ) {
177193 let crate_path = entry. path ( ) ;
You can’t perform that action at this time.
0 commit comments