Skip to content
Snippets Groups Projects
Verified Commit b727cb00 authored by Isabella Skořepová's avatar Isabella Skořepová
Browse files

Dont make config.toml mandatory

Fixes #38
parent e432921a
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -45,9 +45,13 @@ module.exports = function() {
};
var configFile = path.join(config.sourceDir, 'config.toml');
fs.readFile(configFile,'utf-8',function(err,data) {
if(err) return reject('Error reading '+configFile);
if(err) {
console.log('Failed to read configuration from '+configFile);
console.log('Using defaults')
return resolve({config: config});
}
data = toml.parse(data);
console.log(data);
console.log('data: '+data);
for(let attr in config) { data[attr] = config[attr]; }
resolve({config: data});
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment