aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/app.js b/lib/app.js
index f223745..f45e6f9 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -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)