12 lines
571 B
JavaScript
12 lines
571 B
JavaScript
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const directory = path.dirname(fileURLToPath(import.meta.url));
|
|
const sourcePath = path.resolve(directory, "../src/design/agent-console-v4.html");
|
|
const targetPath = path.resolve(directory, "../src/design/prototype.css");
|
|
const source = await fs.readFile(sourcePath, "utf8");
|
|
const match = source.match(/<style>([\s\S]*?)<\/style>/i);
|
|
if (!match) throw new Error("OpenDesign v4 CSS was not found");
|
|
await fs.writeFile(targetPath, `${match[1].trim()}\n`, "utf8");
|