Files
lst_v3/backend/utils/version.utils.ts
Blake Matthes 3e8417dcff
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 3m54s
refactor(builds): refactored the build process to hold in the build info plus version
2026-06-18 13:51:17 -05:00

18 lines
594 B
TypeScript

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}`,
build: parseInt((config.build as string) ?? "1", 0),
lastBuildTime: config.lastBuildDate,
};
};