Skip to content

Commit 5bdb12a

Browse files
committed
fix(build): only load the plugin before build for : build commands
1 parent c92c6b5 commit 5bdb12a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lua/lazy/manage/task/plugin.lua

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ local B = {}
1919
---@param task LazyTask
2020
---@param build string
2121
function B.cmd(task, build)
22+
if task.plugin.build ~= "rockspec" then
23+
Loader.load(task.plugin, { task = "build" })
24+
end
2225
local cmd = vim.api.nvim_parse_cmd(build:sub(2), {}) --[[@as vim.api.keyset.cmd]]
2326
task:log(vim.api.nvim_cmd(cmd, { output = true }))
2427
end
@@ -48,10 +51,6 @@ M.build = {
4851
run = function(self)
4952
vim.cmd([[silent! runtime plugin/rplugin.vim]])
5053

51-
if self.plugin.build ~= "rockspec" then
52-
Loader.load(self.plugin, { task = "build" })
53-
end
54-
5554
local builders = self.plugin.build
5655

5756
-- Skip if `build` is set to `false`

0 commit comments

Comments
 (0)