mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -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));
|
||||
}
|
||||
|
||||
//read the settings sync
|
||||
var settingsStr = fs.readFileSync(settingsFilename).toString();
|
||||
var settingsStr
|
||||
try{
|
||||
//read the settings sync
|
||||
settingsStr = fs.readFileSync(settingsFilename).toString();
|
||||
} catch(e){
|
||||
console.warn('No settings file found. Using defaults.');
|
||||
settingsStr = '{}';
|
||||
}
|
||||
|
||||
//remove all comments
|
||||
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue