mirror of https://github.com/folke/lazy.nvim.git
fix(build): only load the plugin before build for `:` build commands
This commit is contained in:
parent
c92c6b5fd2
commit
5bdb12a038
|
@ -19,6 +19,9 @@ local B = {}
|
|||
---@param task LazyTask
|
||||
---@param build string
|
||||
function B.cmd(task, build)
|
||||
if task.plugin.build ~= "rockspec" then
|
||||
Loader.load(task.plugin, { task = "build" })
|
||||
end
|
||||
local cmd = vim.api.nvim_parse_cmd(build:sub(2), {}) --[[@as vim.api.keyset.cmd]]
|
||||
task:log(vim.api.nvim_cmd(cmd, { output = true }))
|
||||
end
|
||||
|
@ -48,10 +51,6 @@ M.build = {
|
|||
run = function(self)
|
||||
vim.cmd([[silent! runtime plugin/rplugin.vim]])
|
||||
|
||||
if self.plugin.build ~= "rockspec" then
|
||||
Loader.load(self.plugin, { task = "build" })
|
||||
end
|
||||
|
||||
local builders = self.plugin.build
|
||||
|
||||
-- Skip if `build` is set to `false`
|
||||
|
|
Loading…
Reference in New Issue