Skip to content

Commit

Permalink
fix(build): use the shell to execute build commands
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 20, 2022
1 parent ffabe91 commit 1371a14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/lazy/manage/task/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ M.build = {
elseif type(build) == "function" then
build()
else
local args = vim.split(build, "%s+")
return self:spawn(table.remove(args, 1), {
args = args,
local shell = vim.env.SHELL or vim.o.shell
local shell_args = shell:find("cmd.exe", 1, true) and "/c" or "-c"

return self:spawn(shell, {
args = { shell_args, build },
cwd = self.plugin.dir,
})
end
Expand Down

0 comments on commit 1371a14

Please sign in to comment.