fix(build): use the shell to execute build commands

This commit is contained in:
Folke Lemaitre 2022-12-20 16:57:02 +01:00
parent ffabe91b2d
commit 1371a14167
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 5 additions and 3 deletions

View File

@ -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