Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure there is final callback

even if no files have been matched.
  • Loading branch information...
commit 43af677fc2364c17637f5c6396a1225b8d33dc25 1 parent 66c607e
Paul Vorbach authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 bake.js
5 bake.js
View
@@ -12,6 +12,7 @@ var bake = function(conf, hooks, cb) {
// File counter
var todo = 0;
+ var matched = 0;
if (typeof conf != 'object')
return cb(new Error('parameter conf must be a valid configuration object'));
@@ -55,6 +56,7 @@ var bake = function(conf, hooks, cb) {
// Increase file counter
++todo;
+ ++matched;
// Read the master-file's contents
fs.readFile(master, 'utf8', function(err, data) {
@@ -181,6 +183,9 @@ var bake = function(conf, hooks, cb) {
}
});
}
+ }, function () {
+ if (todo == 0)
+ return cb();
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.