Comparing version 0.4.0 to 0.4.1
@@ -258,2 +258,4 @@ /* | ||
Gaze.prototype._watchDir = function(dir, done) { | ||
var self = this; | ||
var timeoutId; | ||
try { | ||
@@ -263,4 +265,7 @@ this._watchers[dir] = fs.watch(dir, function(event) { | ||
// don't fire events on non existent files. | ||
setTimeout(function() { | ||
if (fs.existsSync(dir)) { | ||
clearTimeout(timeoutId); | ||
timeoutId = setTimeout(function() { | ||
// race condition. Ensure that this directory is still being watched | ||
// before continuing. | ||
if ((dir in self._watchers) && fs.existsSync(dir)) { | ||
done(null, dir); | ||
@@ -267,0 +272,0 @@ } |
{ | ||
"name": "gaze", | ||
"description": "A globbing fs.watch wrapper built from the best parts of other fine watch libs.", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"homepage": "https://github.com/shama/gaze", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -154,2 +154,3 @@ # gaze [![Build Status](https://secure.travis-ci.org/shama/gaze.png?branch=master)](http://travis-ci.org/shama/gaze) | ||
## Release History | ||
* 0.4.1 - Fix watchDir not respecting close in race condition (@chrisirhc). | ||
* 0.4.0 - Drop support for node v0.6. Use globule for file matching. Avoid node v0.10 path.resolve/join errors. Register new files when added to non-existent folder. Multiple instances can now poll the same files (@jpommerening). | ||
@@ -156,0 +157,0 @@ * 0.3.4 - Code clean up. Fix path must be strings errors (@groner). Fix incorrect added events (@groner). |
@@ -6,4 +6,6 @@ 'use strict'; | ||
var fs = require('fs'); | ||
var helper = require('./helper'); | ||
var fixtures = path.resolve(__dirname, 'fixtures'); | ||
var sortobj = helper.sortobj; | ||
@@ -35,3 +37,4 @@ exports.add = { | ||
gaze._addToWatched(files); | ||
test.deepEqual(gaze.relative(null, true), expected); | ||
var result = gaze.relative(null, true); | ||
test.deepEqual(sortobj(result), sortobj(expected)); | ||
test.done(); | ||
@@ -38,0 +41,0 @@ }, |
@@ -6,4 +6,6 @@ 'use strict'; | ||
var path = require('path'); | ||
var helper = require('./helper'); | ||
var fixtures = path.resolve(__dirname, 'fixtures'); | ||
var sortobj = helper.sortobj; | ||
@@ -50,4 +52,4 @@ function cleanUp(done) { | ||
var result = this.relative(null, true); | ||
test.deepEqual(result['.'], ['one.js', 'Project (LO)/', 'nested/', 'sub/']); | ||
test.deepEqual(result['sub/'], ['one.js', 'two.js']); | ||
test.deepEqual(sortobj(result['.']), sortobj(['one.js', 'Project (LO)/', 'nested/', 'sub/'])); | ||
test.deepEqual(sortobj(result['sub/']), sortobj(['one.js', 'two.js'])); | ||
this.close(); | ||
@@ -54,0 +56,0 @@ test.done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45853
31
1173
175
8
1