Skip to content

Commit

Permalink
[bin] Skip dotfiles before fs.stat()ing them
Browse files Browse the repository at this point in the history
Not doing so causes problems with Emacs buffer files.
  • Loading branch information
nhunzaker authored and mmalecki committed Feb 6, 2012
1 parent 4342fe9 commit 9dd9b9e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,19 @@ function paths(dir) {
(function traverse(dir, stack) {
stack.push(dir);
fs.readdirSync(stack.join('/')).forEach(function (file) {
//
// Skip dotfiles and `vendor` directory before `fs.stat()`ing them.
// Not doing so causes race conditions with Emacs buffer files
// (`.#filename.js`).
//
if (file[0] == '.' || file === 'vendor') {
return;
}

var path = stack.concat([file]).join('/'),
stat = fs.statSync(path);

if (file[0] == '.' || file === 'vendor') {
return;
} else if (stat.isFile() && fileExt.test(file)) {
if (stat.isFile() && fileExt.test(file)) {
paths.push(path);
} else if (stat.isDirectory()) {
traverse(file, stack);
Expand Down

0 comments on commit 9dd9b9e

Please sign in to comment.