mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
14 lines
375 B
CoffeeScript
14 lines
375 B
CoffeeScript
{PathReplacer} = require 'scandal'
|
|
|
|
module.exports = (filePaths, regexSource, regexFlags, replacementText) ->
|
|
callback = @async()
|
|
|
|
replacer = new PathReplacer()
|
|
regex = new RegExp(regexSource, regexFlags)
|
|
|
|
replacer.on 'path-replaced', (result) ->
|
|
emit('replace:path-replaced', result)
|
|
|
|
replacer.replacePaths regex, replacementText, filePaths, ->
|
|
callback()
|