Permalink
Browse files

avoid breaking on 'ENOTDIR' errors (fixes #2466 in jashkenas/coffee-s…

…cript)
  • Loading branch information...
1 parent 5d7a834 commit ed156bae8d6994ed10b10ec1127f5a3b857dfd7b Attila Oláh committed Jul 28, 2012
Showing with 9 additions and 9 deletions.
  1. +7 −7 lib/coffee-script/command.js
  2. +2 −2 src/command.coffee

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -97,8 +97,8 @@ compilePath = (source, topLevel, base) ->
if stats.isDirectory()
watchDir source, base if opts.watch
fs.readdir source, (err, files) ->
- throw err if err and err.code isnt 'ENOENT'
- return if err?.code is 'ENOENT'
+ throw err if err and not err.code in ['ENOENT', 'ENOTDIR']
+ return if err?.code in ['ENOENT', 'ENOTDIR']
index = sources.indexOf source
files = files.filter (file) -> not hidden file
sources[index..index] = (path.join source, file for file in files)

0 comments on commit ed156ba

Please sign in to comment.