From 1371a141677afe2b0d0d66c96e15ed3ba271bbd9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 20 Dec 2022 16:57:02 +0100 Subject: [PATCH] fix(build): use the shell to execute build commands --- lua/lazy/manage/task/plugin.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/lazy/manage/task/plugin.lua b/lua/lazy/manage/task/plugin.lua index c1703c4..7bb9f33 100644 --- a/lua/lazy/manage/task/plugin.lua +++ b/lua/lazy/manage/task/plugin.lua @@ -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