All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 3m54s
18 lines
594 B
TypeScript
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,
|
|
};
|
|
};
|