Move libs/vars into top scope to prevent re-init

This commit is contained in:
Kyle Robinson Young 2013-07-11 13:14:52 -07:00
parent 99e7a9a16e
commit 042c499de0

View File

@ -6,17 +6,17 @@
* Licensed under the MIT license. * Licensed under the MIT license.
*/ */
module.exports = function(grunt) {
'use strict';
var path = require('path'); var path = require('path');
var Gaze = require('gaze').Gaze; var Gaze = require('gaze').Gaze;
var taskrun = require('./lib/taskrunner')(grunt);
var waiting = 'Waiting...'; var waiting = 'Waiting...';
var changedFiles = Object.create(null); var changedFiles = Object.create(null);
var watchers = []; var watchers = [];
module.exports = function(grunt) {
'use strict';
var taskrun = require('./lib/taskrunner')(grunt);
// When task runner has started // When task runner has started
taskrun.on('start', function() { taskrun.on('start', function() {
grunt.log.ok(); grunt.log.ok();
@ -57,7 +57,7 @@ module.exports = function(grunt) {
var name = self.name || 'watch'; var name = self.name || 'watch';
// Close any previously opened watchers // Close any previously opened watchers
watchers.forEach(function(watcher, i) { watchers.forEach(function(watcher) {
watcher.close(); watcher.close();
}); });
watchers = []; watchers = [];