Skip to content

Commit

Permalink
Log git hash: The buildinfo file path was incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
banban525 committed Oct 26, 2023
1 parent 8d622fa commit 8aba68c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { SystemStatusRepositry } from "./ApiTypes";
import { EventRepository } from "./EventRepository";
import { LogRepository } from "./LogRepository";
import { Logger } from "./Logger";
import path from "path";

let echonetTargetNetwork = "";
let echonetIntervalToGetProperties = 300;
Expand Down Expand Up @@ -176,9 +177,9 @@ const logger = new LogRepository();

Logger.info("", `${process.env.npm_package_name} ver.${process.env.npm_package_version}`);

if(fs.existsSync("../buildinfo"))
if(fs.existsSync(path.resolve(__dirname, "../buildinfo")))
{
const buildInfo = fs.readFileSync("../buildinfo", {encoding:"utf-8"});
const buildInfo = fs.readFileSync(path.resolve(__dirname, "../buildinfo"), {encoding:"utf-8"});
Logger.info("", buildInfo);
}

Expand Down

0 comments on commit 8aba68c

Please sign in to comment.