refactor(builds): refactored how the builds works to include the build number now

this will be for the new lst - ccc
This commit is contained in:
2026-06-17 10:34:53 -05:00
parent 4ff10dfcb2
commit 1b1918dcd0
8 changed files with 192 additions and 152 deletions

View File

@@ -0,0 +1,16 @@
import fsp from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
export const getAppVersion = async () => {
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const version = path.join(__dirname, "../../package.json");
const raw = await fsp.readFile(`${version}`, "utf8");
const config = JSON.parse(raw);
return {
version: `${config.version}.${parseInt((config.build as string) ?? "1", 0) - 1}`,
lastBuildTime: config.lastBuildDate,
};
};