Use single quotes when shelling out to ag.

This prevents `sh` from interpreting $ and \ as special characters.
This commit is contained in:
Corey Johnson & Nathan Sobo
2012-11-05 12:17:21 -08:00
parent 7d5377fe04
commit 3b213e2960

View File

@@ -162,8 +162,7 @@ class Project
_.remove(@buffers, buffer)
scan: (regex, iterator) ->
escapedRegex = regex.source.replace("\\", "\\\\")
command = "#{require.resolve('ag')} --ackmate \"#{escapedRegex}\" \"#{@getPath()}\""
command = "#{require.resolve('ag')} --ackmate '#{regex.source}' '#{@getPath()}'"
bufferedData = ""
state = 'readingPath'