artes 1.7.17 → 1.7.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -21,6 +21,9 @@ function reportCustomizer() {
|
|
|
21
21
|
? report.reportName
|
|
22
22
|
: report.reportName.name || "";
|
|
23
23
|
|
|
24
|
+
|
|
25
|
+
writeProcessStatus();
|
|
26
|
+
|
|
24
27
|
const { buffer: faviconBuffer, mime: faviconMime } =
|
|
25
28
|
readFileAsBuffer(defaultLogoPath());
|
|
26
29
|
const faviconDataUrl = `data:${faviconMime};base64,${faviconBuffer.toString("base64")}`;
|
|
@@ -28,9 +31,11 @@ function reportCustomizer() {
|
|
|
28
31
|
if (isRemoteUrl(report.logo)) {
|
|
29
32
|
return fetchRemoteLogo(report.logo)
|
|
30
33
|
.catch((err) => {
|
|
34
|
+
|
|
31
35
|
console.warn(
|
|
32
|
-
|
|
36
|
+
`\n\x1b[33m Warning: failed to fetch logo from "${report.logo}": ${err.message}. Falling back to default logo.`,
|
|
33
37
|
);
|
|
38
|
+
console.log("\x1b[0m");
|
|
34
39
|
return readFileAsBuffer(defaultLogoPath());
|
|
35
40
|
})
|
|
36
41
|
.then(({ buffer, mime, filename }) => {
|
|
@@ -482,4 +487,25 @@ function updateHtml(htmlPath, report, reportName, faviconDataUrl) {
|
|
|
482
487
|
fs.writeFileSync(htmlPath, html, "utf8");
|
|
483
488
|
}
|
|
484
489
|
|
|
490
|
+
function writeProcessStatus() {
|
|
491
|
+
try {
|
|
492
|
+
const exitCode = process.env.EXIT_CODE || "0";
|
|
493
|
+
const processStatus = {
|
|
494
|
+
exitCode: parseInt(exitCode, 10),
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
const widgetsDir = path.resolve(__dirname, "../../../../../report/widgets");
|
|
498
|
+
|
|
499
|
+
if (!fs.existsSync(widgetsDir)) {
|
|
500
|
+
fs.mkdirSync(widgetsDir, { recursive: true });
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
const statusFilePath = path.join(widgetsDir, "process-status.json");
|
|
504
|
+
fs.writeFileSync(statusFilePath, JSON.stringify(processStatus, null, 2), "utf8");
|
|
505
|
+
} catch (error) {
|
|
506
|
+
console.warn(`\n\x1b[33m Warning: failed to write process status: ${error.message}`);
|
|
507
|
+
console.log("\x1b[0m");
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
485
511
|
module.exports = { reportCustomizer };
|