facebookincubator / retrie

Retrie is a powerful, easy-to-use codemodding tool for Haskell.
MIT License
502 stars 30 forks source link

Make the use of grep optional #30

Open pepeiborra opened 3 years ago

pepeiborra commented 3 years ago

grep causes problems for Windows users[1][2] and its use is probably unnecessary in most projects

[1] - https://github.com/haskell/haskell-language-server/issues/2051 [2] - https://github.com/haskell/haskell-language-server/issues/533

xich commented 3 years ago

Hmmm, does windows have some alternative to grep for "find all files in given directory that contain a given string"? I'm not familiar with windows dev.

We could write a pure Haskell implementation and fall back on that if grep and xargs aren't present. Guessing its going to be a lot slower though. There is a lot of magic in grep to make it fast, which is why I used it.