Permalink
Browse files

fixed empty function

  • Loading branch information...
tommy351 committed Sep 4, 2012
1 parent 1b1eaca commit d90717dbd74c8c9627c38841a3d17e0396794d94
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/qfs.js
View
@@ -253,7 +253,8 @@ var emptyDirSync = function(){
if (stat.isFile()){
fs.unlink(this.path());
} else {
- emptyDirSync.apply(this);
+ this.empty();
+ fs.rmdirSync(this.path());
}
});
};
@@ -274,7 +275,9 @@ var emptyDir = function(callback){
if (stat.isFile()){
fs.unlink(_this.path(), next);
} else {
- emptyDir.call(_this, next);
+ _this.empty(function(){
+ fs.rmdir(_this.path(), next);
+ });
}
});
});

0 comments on commit d90717d

Please sign in to comment.