From fbb25c01554e93b7ccdf816f8c002e07217b0569 Mon Sep 17 00:00:00 2001 From: Stephen Mathieson Date: Tue, 12 Aug 2014 13:08:46 -0400 Subject: [PATCH 1/2] duo-watch.js: Fix glob support This fixes the "default" glob behaviour. The current implementation doesn't support a fallback glob, so we'd effectively watch everything rather than `**/*.{js,css,html}`. --- lib/duo-watch.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/duo-watch.js b/lib/duo-watch.js index 4044dbd..bc22b85 100644 --- a/lib/duo-watch.js +++ b/lib/duo-watch.js @@ -27,16 +27,17 @@ module.exports = Watch; function Watch(root, glob) { if (!(this instanceof Watch)) return new Watch(root, glob); assert(root, 'must pass a root into watch'); - + this.glob = glob || '**/*.{js,css,html}'; + debug('using glob: %s', this.glob); this.root = root; this.mappingPath = join(root, 'components', 'duo.json'); this.watched = function(){}; this.idx = this.index(); - + // file watching - this.sane = sane(root, glob) + this.sane = sane(root, this.glob) .on('change', this.change.bind(this)); } @@ -50,11 +51,11 @@ function Watch(root, glob) { Watch.prototype.deps = function(file, out) { out = out || []; - + var files = this.mapping[file].deps; var root = this.root; var file; - + for (var req in files) { file = files[req]; out.push(file); From 7587014c4c4d765fead0d25837508839e0ce6e06 Mon Sep 17 00:00:00 2001 From: Stephen Mathieson Date: Tue, 12 Aug 2014 13:08:53 -0400 Subject: [PATCH 2/2] gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/