allow startup without settings file
This commit is contained in:
parent
6fc45d6252
commit
90bbf169b2
|
@ -106,9 +106,15 @@ 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…
Reference in New Issue