mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 06:37:10 -04:00
optional settings-file
This commit is contained in:
parent
6188c88e4a
commit
2874e1b904
1 changed files with 13 additions and 4 deletions
|
@ -87,11 +87,20 @@ exports.abiwordAvailable = function()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//read the settings sync
|
var settingsStr = '{}';
|
||||||
var settingsStr = fs.readFileSync(__dirname+"/../../settings.json").toString();
|
|
||||||
|
|
||||||
//remove all comments
|
try
|
||||||
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
{
|
||||||
|
//read the settings sync
|
||||||
|
settingsStr = fs.readFileSync(__dirname+"/../../settings.json").toString();
|
||||||
|
|
||||||
|
//remove all comments
|
||||||
|
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
||||||
|
}
|
||||||
|
catch(e)
|
||||||
|
{
|
||||||
|
console.warn('could not read '+__dirname+"/../../settings.json")
|
||||||
|
}
|
||||||
|
|
||||||
//try to parse the settings
|
//try to parse the settings
|
||||||
var settings;
|
var settings;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue