mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
working, need to test though
This commit is contained in:
parent
7e7eb542be
commit
ddc69831b2
4 changed files with 27 additions and 18 deletions
|
@ -179,6 +179,25 @@ exports.abiwordAvailable = function()
|
|||
}
|
||||
};
|
||||
|
||||
// Provide git version if available
|
||||
exports.getGitCommit = function() {
|
||||
var version = "";
|
||||
try
|
||||
{
|
||||
var rootPath = path.resolve(npm.dir, '..');
|
||||
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 git version is " + version);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
console.warn("Can't get git version for server header\n" + e.message)
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
exports.reloadSettings = function reloadSettings() {
|
||||
// Discover where the settings file lives
|
||||
var settingsFilename = argv.settings || "settings.json";
|
||||
|
@ -261,3 +280,5 @@ exports.reloadSettings = function reloadSettings() {
|
|||
|
||||
// initially load settings
|
||||
exports.reloadSettings();
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue