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:
16
backend/utils/version.utils.ts
Normal file
16
backend/utils/version.utils.ts
Normal 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,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user