tests: reorganize some files, because we are going to copy & paste them.

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.
This commit is contained in:
muxator 2019-12-24 23:40:56 +01:00 committed by muxator
parent 5bcc5a3be0
commit fe0cf4bdb0
2 changed files with 14 additions and 12 deletions

View file

@ -1,13 +1,15 @@
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
var settings;
try {
if(settingsStr) {
settingsStr = jsonminify(settingsStr).replace(",]","]").replace(",}","}");
return JSON.parse(settingsStr);
var settings = JSON.parse(settingsStr);
return settings;
}
}catch(e){
console.error("whoops something is bad with settings");