diff options
author | Benjamin Kiessling <mittagessen@l.unchti.me> | 2012-01-23 01:09:38 +0100 |
---|---|---|
committer | Benjamin Kiessling <mittagessen@l.unchti.me> | 2012-01-23 01:09:38 +0100 |
commit | da10ba8b0d2cbd67866824472442804ad4b4ffd2 (patch) | |
tree | 31cecbc5cd3470e90f846647c9c76d836c6b3b1b /model_fs.js | |
parent | 4c09840a7e756ff4a36c6bbb5fc92a3d3036c5b3 (diff) |
Ignore non-existence of {desc,events}.js
Diffstat (limited to 'model_fs.js')
-rw-r--r-- | model_fs.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/model_fs.js b/model_fs.js index a4d2bef..fb3d015 100644 --- a/model_fs.js +++ b/model_fs.js @@ -36,7 +36,7 @@ exports.rebuildFiles = function() { next(); }).on("file", function(root, fileStats, next) { if(fileStats.name == configuration.description || fileStats.name == configuration.events) { - next(); + next(); } else if(fileStats.name == configuration.template) { var lastDir = root.split('/'); @@ -66,7 +66,7 @@ exports.rebuildFiles = function() { /* collects descriptions and adds them to the slideset */ var collectDescs = function(slideset) { fs.readFile(path.join(__dirname, configuration.dir, slideset, configuration.description), function(err, data) { - if(err) { throw err; } + if(err) { setSlides(slideset, newSlides[slideset], function(err) { if(err) { throw err}}); return; } var descs = JSON.parse(data.toString()); for(var file in newSlides[slideset]['slides']) { if(!newSlides[slideset]['slides'].hasOwnProperty(file)) { continue; } @@ -86,11 +86,11 @@ exports.rebuildFiles = function() { /* collect events and adds them to the slideset */ var collectEvents = function(slideset) { fs.readFile(path.join(__dirname, configuration.dir, slideset, configuration.events), function(err, data) { - if(err) { throw err; } + if(err) { return; } try { var events = JSON.parse(data.toString()); } catch(e) { - throw err; + return; } if(events['type'] == 'text') { setEvents(slideset, events['events'], function(err) { |