diff --git a/node/server.js b/node/server.js index 461e82693..8c70e075d 100644 --- a/node/server.js +++ b/node/server.js @@ -45,8 +45,9 @@ var socketIORouter; var version = ""; try { - var ref = fs.readFileSync("../.git/HEAD", "utf-8"); - var refPath = "../.git/" + ref.substring(5, ref.indexOf("\n")); + var rootPath = path.normalize(__dirname + "/../") + var ref = fs.readFileSync(rootPath + ".git/HEAD", "utf-8"); + var refPath = rootPath + ".git/" + ref.substring(5, ref.indexOf("\n")); version = fs.readFileSync(refPath, "utf-8"); version = version.substring(0, 7); console.log("Your Etherpad Lite git version is " + version);