diff --git a/server/globalUtils/appInfo.ts b/server/globalUtils/appInfo.ts new file mode 100644 index 0000000..7199ab5 --- /dev/null +++ b/server/globalUtils/appInfo.ts @@ -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; + } +};