Skip to content
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.

Commit

Permalink
Merge pull request #40 from krakenjs/dotfiles
Browse files Browse the repository at this point in the history
Naive implementation to ignore dotfiles when scanning.
  • Loading branch information
totherik committed Jun 17, 2014
2 parents a0f611b + 0894e49 commit d413e59
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ function createFileHandler(router) {
function isFileModule(file) {
var ext = path.extname(file);

// Omit dotfiles
// NOTE: Temporary fix in lieu of more complete (cross platform)
// fix using file flags/attributes.
if (path.basename(file, ext)[0] === '.') {
return false;
}

try {
// remove the file extension and use require.resolve to resolve known
// file types eg. CoffeeScript. Will throw if not found/loadable by node.
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/superfluous/.DOT_file
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
throw new Error('Not supported.');
1 change: 1 addition & 0 deletions test/fixtures/superfluous/subsuperfluous/.DotFile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
throw new Error('Not supported.');

0 comments on commit d413e59

Please sign in to comment.