Commit c97b93cc232f30509b4796c6dd93b2e30814c817

Thomas de Grivel 2023-02-26T13:23:47

html

diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index 11575b6..dfc3eb6 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -92,6 +92,7 @@ module Rbpkg
             file = "#{name}.log"
             if ! log[name] || ! FileUtils.uptodate?(file, [subdir_file])
               FileUtils.cp(subdir_file, file)
+              FileUtils.cp("#{subdir_file}.html", "#{file}.html")
               log[name] = true
             end
           end
diff --git a/lib/rbpkg/log.rb b/lib/rbpkg/log.rb
index e60b604..eabf1c2 100644
--- a/lib/rbpkg/log.rb
+++ b/lib/rbpkg/log.rb
@@ -18,9 +18,9 @@ module Rbpkg
       Rbpkg.status_img(status)
     end
 
-    def put_layout
-      tmp = path_html + '.tmp'
-      log = File.read(path)
+    def put_layout(log_path = path, html_path = path_html, s = status)
+      tmp = html_path + '.tmp'
+      log = File.read(log_path)
       html = <<EOF
 <!DOCTYPE html>
 <html lang="en">
@@ -38,7 +38,7 @@ module Rbpkg
       <a href="./"><i class="fas fa-asterisk"></i> All logs</a>
     </div>
     <h1>
-      <img src="#{img}" class="status-#{status.to_s.to_html}"/>
+      <img src="#{img}" class="status-#{s.to_s.to_html}"/>
       #{path.to_html}
     </h1>
     <pre><code>#{log.ansi_to_html}</code></pre>
@@ -46,8 +46,8 @@ module Rbpkg
 </html>
 EOF
       File.write(tmp, html)
-      verbose(3, "Writing #{path_html}")
-      FileUtils.mv(tmp, path_html)
+      verbose(3, "Writing #{html_path}")
+      FileUtils.mv(tmp, html_path)
     end
 
     def puts(string)