mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
allow startup without settings file
This commit is contained in:
parent
6fc45d6252
commit
90bbf169b2
1 changed files with 9 additions and 3 deletions
|
@ -106,8 +106,14 @@ if (settingsFilename.charAt(0) != '/') {
|
||||||
settingsFilename = path.normalize(path.join(root, settingsFilename));
|
settingsFilename = path.normalize(path.join(root, settingsFilename));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var settingsStr
|
||||||
|
try{
|
||||||
//read the settings sync
|
//read the settings sync
|
||||||
var settingsStr = fs.readFileSync(settingsFilename).toString();
|
settingsStr = fs.readFileSync(settingsFilename).toString();
|
||||||
|
} catch(e){
|
||||||
|
console.warn('No settings file found. Using defaults.');
|
||||||
|
settingsStr = '{}';
|
||||||
|
}
|
||||||
|
|
||||||
//remove all comments
|
//remove all comments
|
||||||
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue