Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-fu committed Feb 16, 2015
1 parent 0989244 commit 21918cf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/find.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ find = module.exports.async = (source, options, cb , depth = 0 ) ->
list = []
# Check the current file through filter options
filter.async source, depth, options, (ok) ->
return cb null, list unless options.lazy and ok
list.push source
return cb null, list if options.lazy and not ok
list.push source if ok
# check source entry
stat = if options.dereference? then fs.stat else fs.lstat
stat source, (err, stats) ->
Expand Down Expand Up @@ -80,9 +80,10 @@ find = module.exports.async = (source, options, cb , depth = 0 ) ->
# If anything out of order happened.
findSync = module.exports.sync = (source, options = {}, depth = 0) ->
list = []
return list unless options.lazy and filter.sync source, depth, options
ok = filter.sync source, depth, options
return list if options.lazy and not ok
# Check the current file through filter options
list.push source
list.push source if ok
# check source entry
stat = if options.dereference? then fs.statSync else fs.lstatSync
try
Expand Down

0 comments on commit 21918cf

Please sign in to comment.