feat(pkgdata): moved the pkg info to a global function
This commit is contained in:
15
server/globalUtils/appInfo.ts
Normal file
15
server/globalUtils/appInfo.ts
Normal 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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user