You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really enjoying this plugin, thanks so much for making it.
I'm using it on Linux and Mac. Linux no issues, but I don't use homebrew on my macbook, I install all my packages through nix + home-manager. This means I have gnused installed as sed and no binary gsed. And that causes two issues:
I get a warning from here that I don't have gnused installed (this isn't blocking, but is mildly annoying).
When I go to actually do a replacement on a Mac I get a gsed not found error. This part can be worked around by setting require("spectre").setup({ replace_engine = { sed = { cmd = "sed" } } }) but it took me a while to figure out this solution.
There doesn't seem to be any "standard" solution to checking if the binary sed is the GNU or BSD version on any particular system, but that seems like the actual check that should be done. Maybe doing something like vim.fn.system("sed --version | grep GNU") as a check would work.
Or maybe it's easier to just add a print_warnings option that defaults to true and people can override the sed command in setup().
The workaround I ended up going with was creating a gsed binary that calls sed on my system (included below for any other nix on mac users). But I thought I'd report the issue in case you had the appetite to improve the "sed type detection" part (I also wonder what would happen on a *BSD OS or busybox based linux, those probably have non-gnu sed too).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Without this, no arguments will be passed to sed, which will then fail and result in a cryptic [] ERROR [] ERROR [] ERROR [] ERROR [] ERROR ... message from replace, like in the screenshot from this issue: #141 (comment). I've spent an embarrassing amount of time to find this out the hard way..
Really enjoying this plugin, thanks so much for making it.
I'm using it on Linux and Mac. Linux no issues, but I don't use homebrew on my macbook, I install all my packages through nix + home-manager. This means I have gnused installed as
sed
and no binarygsed
. And that causes two issues:gsed not found
error. This part can be worked around by settingrequire("spectre").setup({ replace_engine = { sed = { cmd = "sed" } } })
but it took me a while to figure out this solution.There doesn't seem to be any "standard" solution to checking if the binary
sed
is the GNU or BSD version on any particular system, but that seems like the actual check that should be done. Maybe doing something likevim.fn.system("sed --version | grep GNU")
as a check would work.Or maybe it's easier to just add a
print_warnings
option that defaults to true and people can override thesed
command insetup()
.The workaround I ended up going with was creating a
gsed
binary that callssed
on my system (included below for any other nix on mac users). But I thought I'd report the issue in case you had the appetite to improve the "sed
type detection" part (I also wonder what would happen on a *BSD OS or busybox based linux, those probably have non-gnu sed too).The text was updated successfully, but these errors were encountered: