From 8beed14b899df2b434790e900f2c6bc4520a0ad6 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Sat, 19 Apr 2014 17:45:42 -0700 Subject: [PATCH] allow ignored paths to be passed in --- bin/lute.js | 3 +-- lib/serve/index.js | 4 ++-- lib/serve/watch.js | 10 ++++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/bin/lute.js b/bin/lute.js index bac8f2c..1ba8066 100755 --- a/bin/lute.js +++ b/bin/lute.js @@ -5,5 +5,4 @@ var isInt = require('../lib/util/isInt'); var serve = require('../lib/serve'); var port = (argv.p && isInt(argv.p)) ? argv.p : 8080; -// if a port or no args, start server -serve(port, (argv._.indexOf('open') !== -1)); +serve(port, (argv._.indexOf('open') !== -1), argv); diff --git a/lib/serve/index.js b/lib/serve/index.js index 3b4756e..54c670c 100644 --- a/lib/serve/index.js +++ b/lib/serve/index.js @@ -2,11 +2,11 @@ var createLiveReload = require('./createLiveReload'); var createServer = require('./createServer'); var watch = require('./watch'); -module.exports = function(port, open) { +module.exports = function(port, open, argv) { createLiveReload(function(err, liveReload, lrPort){ createServer(port, lrPort, open, function(err, server){ - watch(liveReload); + watch(liveReload, argv); }); }); diff --git a/lib/serve/watch.js b/lib/serve/watch.js index dbf3f76..c0422d9 100644 --- a/lib/serve/watch.js +++ b/lib/serve/watch.js @@ -1,9 +1,15 @@ var gulp = require('gulp'); var gutil = require('gulp-util'); -module.exports = function(liveReload) { +module.exports = function(liveReload, argv) { - gulp.watch(["./**/*", "!./node_modules/**/*", "!./bower_components/**/*"], function(evt){ + var paths = ["./**/*", "!./node_modules/**/*"]; + var ignorePaths = (argv.i) ? argv.i.split(',') : []; + for(var i=0; i