Commit 369186516c2095e3610110b62e89489c820fba06

Thomas de Grivel 2023-02-15T01:07:56

shpkg_ci

diff --git a/bin/shpkg_ci b/bin/shpkg_ci
index 3b257a8..e1e82ad 100755
--- a/bin/shpkg_ci
+++ b/bin/shpkg_ci
@@ -25,6 +25,8 @@ SHPKG_CI_STATUS_DIR="${SHPKG_CI_DIR}/status/${SHPKG_OS_}/${SHPKG_TARGET}"
 
 log2html () {
     {
+        TITLE="$(echo "$1" | ansi2html)"
+        STATUS="$(< "${SHPKG_CI_STATUS_DIR}/$(basename "$1" .log).status")"
         cat <<EOF
 <!DOCTYPE html>
 <html lang="en">
@@ -32,23 +34,19 @@ log2html () {
     <meta charset="utf-8"/>
     <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
     <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
-    <title>
-EOF
-        cat <<EOF
-</title>
+    <title>${TITLE}</title>
     <link rel="stylesheet" href="/_assets/app.css">
     <script defer type="text/javascript" src="/_assets/app.js"></script>
-    <link rel="icon" type="image/png" sizes="128x128" href="/_images/ci.128.png">
-    <link rel="icon" type="image/png" sizes="64x64" href="/_images/ci.64.png">
-    <link rel="icon" type="image/png" sizes="32x32" href="/_images/ci.32.png">
-    <link rel="icon" type="image/png" sizes="16x16" href="/_images/ci.16.png">
+    <link rel="icon" type="image/png" sizes="128x128" href="/_images/status_${STATUS}.128.png">
+    <link rel="icon" type="image/png" sizes="64x64" href="/_images/status_${STATUS}.64.png">
+    <link rel="icon" type="image/png" sizes="32x32" href="/_images/status_${STATUS}.32.png">
+    <link rel="icon" type="image/png" sizes="16x16" href="/_images/status_${STATUS}.16.png">
   </head>
   <body>
     <h1>
-EOF
-        echo "$1" | ansi2html
-        cat <<EOF
-</h1>
+      <img src="/_images/status_${STATUS}.128.png" class="status-${STATUS}"/>
+      ${TITLE}
+    </h1>
     <pre><code>
 EOF
         ansi2html < "$1"