Commit 8815d0317c28994a9053b305a4f9cb90f41648be

Thomas de Grivel 2023-02-28T11:58:03

ci_mux

diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index ca88a2a..6dc860d 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -114,22 +114,24 @@ EOF
     log = {}
     Dir.chdir("#{Rbpkg.ci_dir}/log") do
       Dir["*/*"].each do |d|
-        Dir.chdir(d) do
-          Dir["*/*.log"].each do |subdir_file|
-            name = File.basename(subdir_file, ".log")
-            d_name = "#{d}/#{name}"
-            file = "#{name}.log"
-            if ! File.exist?(file) || File.mtime(file) <= File.mtime(subdir_file)
-              FileUtils.cp(subdir_file, file)
-              subdir_file_html = "#{subdir_file}.html"
-              FileUtils.cp(subdir_file_html, "#{file}.html")
-              log_item = {log: subdir_file,
-                          html: subdir_file_html,
-                          status: status[name][d_name]}
-              if ! log[name]
-                log[name] = {}
+        if File.directory?(d)
+          Dir.chdir(d) do
+            Dir["*/*.log"].each do |subdir_file|
+              name = File.basename(subdir_file, ".log")
+              d_name = "#{d}/#{name}"
+              file = "#{name}.log"
+              if ! File.exist?(file) || File.mtime(file) <= File.mtime(subdir_file)
+                FileUtils.cp(subdir_file, file)
+                subdir_file_html = "#{subdir_file}.html"
+                FileUtils.cp(subdir_file_html, "#{file}.html")
+                log_item = {log: subdir_file,
+                            html: subdir_file_html,
+                            status: status[name][d_name]}
+                if ! log[name]
+                  log[name] = {}
+                end
+                log[name][d_name] = log_item
               end
-              log[name][d_name] = log_item
             end
           end
         end