Permalink
Browse files

resolving more stuff just in case

  • Loading branch information...
1 parent 9a5e7b2 commit e3b6c77380d39e78772f131dbe8ac0f3a8959684 @owiber owiber committed Jun 5, 2012
Showing with 12 additions and 11 deletions.
  1. +12 −11 lib/supervisor.js
View
@@ -100,7 +100,7 @@ function run (args) {
if (ignore) {
var ignoreItems = ignore.split(',');
ignoreItems.forEach(function (ignoreItem) {
- ignoreItem = path.resolve(ignoreItem + '/');
+ ignoreItem = path.resolve(ignoreItem);
ignoredPaths[ignoreItem] = true;
util.debug("Ignoring directory '" + ignoreItem + "'.");
});
@@ -245,29 +245,30 @@ function watchGivenFile (watch, poll_interval) {
util.debug("watching file '" + watch + "'");
}
-var findAllWatchFiles = function(path, callback) {
- if (ignoredPaths[path])
+var findAllWatchFiles = function(dir, callback) {
+ dir = path.resolve(dir);
+ if (ignoredPaths[dir])
return;
- fs.stat(path, function(err, stats){
+ fs.stat(dir, function(err, stats){
if (err) {
- util.error('Error retrieving stats for file: ' + path);
+ util.error('Error retrieving stats for file: ' + dir);
} else if (isWindows) {
- callback(path);
+ callback(dir);
} else {
if (stats.isDirectory()) {
- fs.readdir(path, function(err, fileNames) {
+ fs.readdir(dir, function(err, fileNames) {
if(err) {
- util.error('Error reading path: ' + path);
+ util.error('Error reading path: ' + dir);
}
else {
fileNames.forEach(function (fileName) {
- findAllWatchFiles(path + '/' + fileName, callback);
+ findAllWatchFiles(dir + '/' + fileName, callback);
});
}
});
} else {
- if (path.match(fileExtensionPattern)) {
- callback(path);
+ if (dir.match(fileExtensionPattern)) {
+ callback(dir);
}
}
}

0 comments on commit e3b6c77

Please sign in to comment.