Redid tabs and added some comments for explainin'

This commit is contained in:
Bram van der Veen 2015-06-16 15:26:12 +02:00
parent 46992803e1
commit a0c9330afb

View file

@ -3,37 +3,38 @@ var fs = require('fs');
//Function for loading and returning the settings.json file, makes one if there isn't one. //Function for loading and returning the settings.json file, makes one if there isn't one.
module.exports = function () { module.exports = function () {
if (!fs.existsSync(__dirname + '/settings.json')) { if (!fs.existsSync(__dirname + '/settings.json')) {
var settings = { //Template for settings.json if not available.
'env' : 'dev', var settings = {
'database' : 'example.com/database', 'env' : 'dev',
'web_port' : 1024, 'database' : 'example.com/database',
'amount_of_hours' : 7, 'web_port' : 1024,
'hour_times' : [ 'amount_of_hours' : 7,
'8:45 - 9:45', 'hour_times' : [
'9:45 - 10:45', '8:45 - 9:45',
'11:10 - 12:10', '9:45 - 10:45',
'12:10 - 13:10', '11:10 - 12:10',
'13:40 - 14:40', '12:10 - 13:10',
'14:40 - 15:40', '13:40 - 14:40',
'15:40 - 16:40' '14:40 - 15:40',
], '15:40 - 16:40'
'school_id' : 934, ],
'links' : { 'school_id' : 934,
'Login': ['#', '#96AA48'], 'links' : {
'Magister': ['http://werkman.magister.net', '#0C5489'], 'Login': ['#', '#96AA48'],
'Mail': ['https://login.microsoftonline.com/', '#C41824'] 'Magister': ['http://werkman.magister.net', '#0C5489'],
'Mail': ['https://login.microsoftonline.com/', '#C41824']
}
} }
} fs.writeFileSync(__dirname + '/settings.json', JSON.stringify(settings, null, 2));
fs.writeFileSync(__dirname + '/settings.json', JSON.stringify(settings, null, 2));
return settings; return settings;
} }
else { else {
return JSON.parse(fs.readFileSync(__dirname + '/settings.json')); return JSON.parse(fs.readFileSync(__dirname + '/settings.json'));
} }
} }
if (process.argv[2] == 'test') { if (process.argv[2] == 'test') {
console.log(module.exports()); console.log(module.exports());
} }