Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check folder exists before trying to remove

  • Loading branch information...
commit f57ba3933ed6d9c46198cd5fb9971ffcfc11c22e 1 parent 1719566
@bencevans authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 app.js
View
7 app.js
@@ -57,8 +57,11 @@ var server = http.createServer(function (req, res) {
res.end(template(locals));
setInterval(function() {
- wrench.rmdirRecursive(path, function(err){
- if(err) return console.error(err);
+ fs.exists(path, function(exists) {
+ if(!exists) return false;
+ wrench.rmdirRecursive(path, function(err){
+ if(err) return console.error(err);
+ });
});
}, 15000);
});
Please sign in to comment.
Something went wrong with that request. Please try again.