build: reduce build log noise

This commit is contained in:
Peter Steinberger
2026-03-08 04:12:32 +00:00
parent a035a3ce48
commit dd8fd98ad4
5 changed files with 95 additions and 49 deletions

View File

@@ -9,6 +9,7 @@ import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const projectRoot = path.resolve(__dirname, "..");
const verbose = process.env.OPENCLAW_BUILD_VERBOSE === "1";
const srcDir = path.join(projectRoot, "src", "auto-reply", "reply", "export-html");
const distDir = path.join(projectRoot, "dist", "export-html");
@@ -26,12 +27,16 @@ function copyExportHtmlTemplates() {
// Copy main template files
const templateFiles = ["template.html", "template.css", "template.js"];
let copiedCount = 0;
for (const file of templateFiles) {
const srcFile = path.join(srcDir, file);
const distFile = path.join(distDir, file);
if (fs.existsSync(srcFile)) {
fs.copyFileSync(srcFile, distFile);
console.log(`[copy-export-html-templates] Copied ${file}`);
copiedCount += 1;
if (verbose) {
console.log(`[copy-export-html-templates] Copied ${file}`);
}
}
}
@@ -48,12 +53,15 @@ function copyExportHtmlTemplates() {
const distFile = path.join(distVendor, file);
if (fs.statSync(srcFile).isFile()) {
fs.copyFileSync(srcFile, distFile);
console.log(`[copy-export-html-templates] Copied vendor/${file}`);
copiedCount += 1;
if (verbose) {
console.log(`[copy-export-html-templates] Copied vendor/${file}`);
}
}
}
}
console.log("[copy-export-html-templates] Done");
console.log(`[copy-export-html-templates] Copied ${copiedCount} export-html assets.`);
}
copyExportHtmlTemplates();