feat(pkgdata): moved the pkg info to a global function

This commit is contained in:
2025-03-14 13:35:45 -05:00
parent 242494a4ea
commit 51b81b97bc

View File

@@ -0,0 +1,15 @@
import path from "path";
import {createLog} from "../services/logger/logger.js";
import fs from "fs";
export const getAppInfo = async (appLock: string) => {
try {
const packagePath = path.join(appLock, "package.json");
const packageJson = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
//const version = packageJson.version;
return packageJson;
} catch (error) {
createLog("error", "lst", "zipUpBuild", `Error in getting the version: ${error}`);
return error;
}
};