summaryrefslogtreecommitdiff
path: root/model_fs.js
diff options
context:
space:
mode:
authorBenjamin Kiessling <mittagessen@l.unchti.me>2012-01-23 15:40:23 +0100
committerBenjamin Kiessling <mittagessen@l.unchti.me>2012-01-23 15:40:23 +0100
commit84da8d4b9bfab520a1bc0844773334b7131794c4 (patch)
tree5afd486379cf07e0d49bd5e9040e0ba09f24991c /model_fs.js
parent623d5ec42150b761cb7b3b56c7b7b9eaaf5c1e23 (diff)
Add flag to ignore dot files in watcher
Diffstat (limited to 'model_fs.js')
-rw-r--r--model_fs.js6
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);