Permalink
Browse files

make pages use filesystem helper to remove the files. fix an undefine…

…d variable error in filesystem helper.
  • Loading branch information...
1 parent a6f2d95 commit a47507b706806743f1146779b11b2ce0928ef817 projectmoon committed Sep 27, 2012
Showing with 5 additions and 3 deletions.
  1. +1 −1 lib/blog.js
  2. +1 −1 lib/filesystem-helper.js
  3. +3 −1 lib/pages.js
View
@@ -8,7 +8,7 @@ var hound = require('hound'),
keyManager = require('./keymanager').KeyManager,
FilesystemHelper = require('./filesystem-helper').FilesystemHelper;
-//constants
+//import the page connector constants for ease of use.
var upsertResult = redis.upsertResult;
//singleton to enable events.
View
@@ -41,7 +41,7 @@ FilesystemHelper.prototype.readMarkdown = function(dir, callback) {
FilesystemHelper.prototype.remove = function(filename, callback) {
fs.unlink(filename, function(err) {
- if (typeof callback !== 'undefined') callback(unlinkErr);
+ if (typeof callback !== 'undefined') callback(err);
});
}
View
@@ -117,6 +117,8 @@ pages.open = function(directory, callback) {
}
dir = directory;
+ fsh = new FilesystemHelper(directory);
+
redis.open(cfg, function(err, success) {
if (err) return callback(err);
@@ -177,7 +179,7 @@ pages.remove = function(title, callback) {
redis.removePage(title, function(err) {
if (err) return callback(err);
- fs.unlink(filename, function(err) {
+ fsh.remove(filename, function(err) {
callback(err);
});
});

0 comments on commit a47507b

Please sign in to comment.