From 6e617dd69a14198f44738631780a33661038606d Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 18 Apr 2016 10:59:55 -0400 Subject: [PATCH] closes #4520 --- Gruntfile.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index a6aca2083a..b9422b7661 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,15 +7,16 @@ var fork = require('child_process').fork, module.exports = function(grunt) { + var args = []; + if (!grunt.option('verbose')) { + args.push('--log-level=info'); + } + function update(action, filepath, target) { - var args = [], + var updateArgs = args, fromFile = '', compiling = '', time = Date.now(); - - if (!grunt.option('verbose')) { - args.push('--log-level=info'); - } if (target === 'lessUpdated_Client') { fromFile = ['js', 'tpl', 'acpLess']; @@ -37,11 +38,11 @@ module.exports = function(grunt) { return incomplete.indexOf(ext) === -1; }); - args.push('--from-file=' + fromFile.join(',')); + updateArgs.push('--from-file=' + fromFile.join(',')); incomplete.push(compiling); worker.kill(); - worker = fork('app.js', args, { env: env }); + worker = fork('app.js', updateArgs, { env: env }); worker.on('message', function() { if (incomplete.length) { @@ -101,6 +102,6 @@ module.exports = function(grunt) { env.NODE_ENV = 'development'; - worker = fork('app.js', [], { env: env }); + worker = fork('app.js', args, { env: env }); grunt.event.on('watch', update); }; \ No newline at end of file