@@ -1896,6 +1896,22 @@ impl UCommand {
18961896 /// Spawns the command, feeds the stdin if any, and returns the
18971897 /// child process immediately.
18981898
1899+ fn list_directory_contents ( path : & Path , prefix : & str ) {
1900+ if let Ok ( entries) = fs:: read_dir ( path) {
1901+ for entry in entries {
1902+ if let Ok ( entry) = entry {
1903+ let path_str = entry. path ( ) . to_string_lossy ( ) . to_string ( ) ;
1904+ log_info ( & format ! ( "{}File:" , prefix) , & path_str) ;
1905+
1906+ // Recursively list contents if it's a directory
1907+ if entry. path ( ) . is_dir ( ) {
1908+ Self :: list_directory_contents ( & entry. path ( ) , & format ! ( "{} " , prefix) ) ;
1909+ }
1910+ }
1911+ }
1912+ }
1913+ }
1914+
18991915 pub fn run_no_wait ( & mut self ) -> UChild {
19001916 assert ! ( !self . has_run, "{}" , ALREADY_RUN ) ;
19011917 self . has_run = true ;
@@ -1904,14 +1920,9 @@ impl UCommand {
19041920 let target_path = Path :: new ( "/project/target" ) ;
19051921 if target_path. exists ( ) && target_path. is_dir ( ) {
19061922 match fs:: read_dir ( target_path) {
1907- Ok ( entries ) => {
1923+ Ok ( _ ) => {
19081924 log_info ( "Files in /project/target/" , "" ) ;
1909- for entry in entries {
1910- if let Ok ( entry) = entry {
1911- let path_str = entry. path ( ) . to_string_lossy ( ) . to_string ( ) ;
1912- log_info ( " File:" , & path_str) ;
1913- }
1914- }
1925+ Self :: list_directory_contents ( target_path, " " ) ;
19151926 }
19161927 Err ( e) => log_info ( "Error reading /project/target/" , & e. to_string ( ) ) ,
19171928 }
0 commit comments