This commit is contained in:
Ben Ogle
2014-07-01 10:32:30 -07:00
parent de9f070f53
commit 06d06d10e0
4 changed files with 6 additions and 8 deletions

View File

@@ -239,7 +239,7 @@ class Project extends Model
task.on 'scan:result-found', (result) =>
iterator(result) unless @isPathModified(result.filePath)
task.on 'scan:file-error', (error) =>
task.on 'scan:file-error', (error) ->
iterator(null, error)
if _.isFunction(options.onPathsSearched)

View File

@@ -6,9 +6,8 @@ module.exports = (filePaths, regexSource, regexFlags, replacementText) ->
replacer = new PathReplacer()
regex = new RegExp(regexSource, regexFlags)
replacer.on 'file-error', (e) ->
error = {code: e.code, path: e.path, message: e.message}
emit('replace:file-error', error)
replacer.on 'file-error', ({code, path, message}) ->
emit('replace:file-error', {code, path, message})
replacer.on 'path-replaced', (result) ->
emit('replace:path-replaced', result)

View File

@@ -9,9 +9,8 @@ module.exports = (rootPath, regexSource, options) ->
searcher = new PathSearcher()
scanner = new PathScanner(rootPath, options)
searcher.on 'file-error', (e) ->
error = {code: e.code, path: e.path, message: e.message}
emit('scan:file-error', error)
searcher.on 'file-error', ({code, path, message}) ->
emit('scan:file-error', {code, path, message})
searcher.on 'results-found', (result) ->
emit('scan:result-found', result)