Skip to content

Commit

Permalink
fix(sed): detect sed on darwin
Browse files Browse the repository at this point in the history
use sed if available in darwin, useful for darwin-nix users where `gnused` is installed as `sed`
  • Loading branch information
med8bra authored Jul 29, 2024
1 parent 9a28f92 commit af29667
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/spectre/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ end

M.check_replace_cmd_bins = function()
if state.user_config.default.replace.cmd == 'sed' then
if vim.loop.os_uname().sysname == 'Darwin' then
if vim.loop.os_uname().sysname == 'Darwin' and vim.fn.executable('sed') == 0 then
config.replace_engine.sed.cmd = 'gsed'
if vim.fn.executable('gsed') == 0 and state.user_config.replace_engine.sed.warn then
print("You need to install gnu sed 'brew install gnu-sed'")
Expand Down

0 comments on commit af29667

Please sign in to comment.