mirror of
https://github.com/logseq/logseq.git
synced 2026-05-01 01:16:27 +00:00
18 lines
461 B
JavaScript
18 lines
461 B
JavaScript
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
const renderPath = path.join(__dirname, "..", "src", "logseq", "publish", "render.cljs");
|
|
const source = fs.readFileSync(renderPath, "utf8");
|
|
const timestamp = Date.now();
|
|
|
|
const next = source.replace(
|
|
/\(defonce version [^)]+\)/,
|
|
`(defonce version ${timestamp})`
|
|
);
|
|
|
|
if (next === source) {
|
|
throw new Error("Failed to update logseq.publish.render/version.");
|
|
}
|
|
|
|
fs.writeFileSync(renderPath, next);
|