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 elseif type(build) == "function" then
build() build()
else else
local args = vim.split(build, "%s+") local shell = vim.env.SHELL or vim.o.shell
return self:spawn(table.remove(args, 1), { local shell_args = shell:find("cmd.exe", 1, true) and "/c" or "-c"
args = args,
return self:spawn(shell, {
args = { shell_args, build },
cwd = self.plugin.dir, cwd = self.plugin.dir,
}) })
end end