get the proper git revision even when not started from node dir
parent
b1faa8e0f8
commit
7dcc7be8e0
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue