diff options
author | Benjamin Kiessling <mittagessen@l.unchti.me> | 2012-01-23 15:40:23 +0100 |
---|---|---|
committer | Benjamin Kiessling <mittagessen@l.unchti.me> | 2012-01-23 15:40:23 +0100 |
commit | 84da8d4b9bfab520a1bc0844773334b7131794c4 (patch) | |
tree | 5afd486379cf07e0d49bd5e9040e0ba09f24991c /model_fs.js | |
parent | 623d5ec42150b761cb7b3b56c7b7b9eaaf5c1e23 (diff) |
Add flag to ignore dot files in watcher
Diffstat (limited to 'model_fs.js')
-rw-r--r-- | model_fs.js | 6 |
1 files changed, 5 insertions, 1 deletions
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); |