Commit 71b14468 by Marvin Hagemeister

Add descendent files to watched files

Fixes #1731
parent 2882d6b7
...@@ -266,9 +266,17 @@ function watch(options, emitter) { ...@@ -266,9 +266,17 @@ function watch(options, emitter) {
gaze.on('changed', function(file) { gaze.on('changed', function(file) {
var files = [file]; var files = [file];
// descendents may be added, so we need a new graph
graph = buildGraph(options);
graph.visitAncestors(file, function(parent) { graph.visitAncestors(file, function(parent) {
files.push(parent); files.push(parent);
}); });
// Add children to watcher
graph.visitDescendents(file, function(child) {
gaze.add(child);
});
files.forEach(function(file) { files.forEach(function(file) {
if (path.basename(file)[0] !== '_') { if (path.basename(file)[0] !== '_') {
renderFile(file, options, emitter); renderFile(file, options, emitter);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment