fe0cf4bdb0
In the following commits Pierre is going to copy & modify some files. This commit prepares the source files in order to minimize those differences, so we can re-unify them as soon as possible. No functional changes.
19 lines
543 B
JavaScript
19 lines
543 B
JavaScript
var jsonminify = require(__dirname+"/../../src/node_modules/jsonminify");
|
|
const fs = require('fs');
|
|
|
|
function loadSettings(){
|
|
var settingsStr = fs.readFileSync(__dirname+"/../../settings.json").toString();
|
|
// try to parse the settings
|
|
try {
|
|
if(settingsStr) {
|
|
settingsStr = jsonminify(settingsStr).replace(",]","]").replace(",}","}");
|
|
var settings = JSON.parse(settingsStr);
|
|
|
|
return settings;
|
|
}
|
|
}catch(e){
|
|
console.error("whoops something is bad with settings");
|
|
}
|
|
}
|
|
|
|
exports.loadSettings = loadSettings;
|