diff options
-rw-r--r-- | lib/app.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1512,11 +1512,12 @@ App.prototype.saveDraft = function (id, url, form, content, cb) { App.prototype.getDraft = function (id, cb) { var self = this - fs.readFile(path.join(self.draftsDir, id), 'utf8', function (err, data) { + var filename = path.join(self.draftsDir, id) + fs.readFile(filename, 'utf8', function (err, data) { if (err) return cb(err) var draft try { draft = JSON.parse(data) } - catch(e) { return cb(e) } + catch(e) { return cb(new Error('JSON Error reading ' + filename + ': ' + e.stack)) } draft.id = id cb(null, draft) }) @@ -1533,6 +1534,9 @@ function compareMtime(a, b) { function statAll(files, dir, cb) { pull( pull.values(files), + pull.filter(function (file) { + return !/^\./.test(file) + }), paramap(function (file, cb) { fs.stat(path.join(dir, file), function (err, stats) { if (err) return cb(err) |