From c83d3680415a594dc94a2a9bb0095a15f13ea9c7 Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Sat, 2 Jan 2016 03:00:54 -0600 Subject: [PATCH] Use filter/map in watch task --- tgui/gulp/tasks/watch.coffee | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tgui/gulp/tasks/watch.coffee b/tgui/gulp/tasks/watch.coffee index 606d924625863..a07d3dc1295ad 100644 --- a/tgui/gulp/tasks/watch.coffee +++ b/tgui/gulp/tasks/watch.coffee @@ -10,9 +10,8 @@ reload = require "./reload" module.exports = -> - paths = [] - for i,path of p - paths.push "#{path.dir}**" if path.dir - - gulp.watch paths, debounce(gulp.series(clean, build, reload), 1000) + gulp.watch( + Object.keys(p).filter((path) -> p[path].dir?).map((path) -> p[path].dir + "**"), + debounce gulp.series(clean, build, reload), 1000 + ) module.exports.displayName = "watch"