From 84da8d4b9bfab520a1bc0844773334b7131794c4 Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Mon, 23 Jan 2012 15:40:23 +0100 Subject: Add flag to ignore dot files in watcher --- model_fs.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/model_fs.js b/model_fs.js index de2f56f..eaafa94 100644 --- a/model_fs.js +++ b/model_fs.js @@ -12,7 +12,11 @@ var files = []; exports.start = function(config) { configuration = config; - watcher = require('watch-tree').watchTree(configuration.dir, {'sample-rate': 5}); + if(typeof configuration.ignoreDotFiles !== 'undefined' && configuration.ignoreDotFiles == 'false') { + watcher = require('watch-tree').watchTree(configuration.rootDir, {}); + } else { + watcher = require('watch-tree').watchTree(configuration.rootDir, {ignore: '.*'}); + } watcher.on('fileDeleted', exports.rebuildFiles); watcher.on('fileCreated', exports.rebuildFiles); watcher.on('fileModified', exports.rebuildFiles); -- cgit v1.2.1