mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
25 lines
521 B
TypeScript
25 lines
521 B
TypeScript
import child_process from "child_process";
|
|
import fs from "fs";
|
|
|
|
function getBuildDate() {
|
|
const now = new Date();
|
|
now.setMilliseconds(0);
|
|
return now
|
|
.toISOString()
|
|
.replace(".000", "");
|
|
}
|
|
|
|
function getGitRevision() {
|
|
return child_process.execSync('git log -1 --format="%H"')
|
|
.toString("utf-8")
|
|
.trimEnd();
|
|
}
|
|
|
|
const output = `\
|
|
export = {
|
|
buildDate: "${getBuildDate()}",
|
|
buildRevision: "${getGitRevision()}"
|
|
};
|
|
`;
|
|
|
|
fs.writeFileSync("src/services/build.ts", output); |