mirror of https://github.com/folke/lazy.nvim.git
refactor: Task.needed => task.skip
This commit is contained in:
parent
3768256956
commit
16fd35c285
|
@ -1,7 +1,7 @@
|
|||
local Process = require("lazy.manage.process")
|
||||
|
||||
---@class LazyTaskDef
|
||||
---@field needed? fun(plugin:LazyPlugin, opts:RunnerOpts):any?
|
||||
---@field skip? fun(plugin:LazyPlugin, opts:RunnerOpts):any?
|
||||
---@field run fun(task:LazyTask)
|
||||
|
||||
---@alias LazyTaskState fun():boolean?
|
||||
|
|
|
@ -5,8 +5,8 @@ local Loader = require("lazy.core.loader")
|
|||
local M = {}
|
||||
|
||||
M.run = {
|
||||
needed = function(plugin)
|
||||
return plugin._.dirty and (plugin.opt == false or plugin.run)
|
||||
skip = function(plugin)
|
||||
return not (plugin._.dirty and (plugin.opt == false or plugin.run))
|
||||
end,
|
||||
run = function(self)
|
||||
Loader.load(self.plugin, { task = "run" }, { load_start = true })
|
||||
|
@ -52,8 +52,8 @@ M.clean = {
|
|||
}
|
||||
|
||||
M.docs = {
|
||||
needed = function(plugin)
|
||||
return plugin._.dirty
|
||||
skip = function(plugin)
|
||||
return not plugin._.dirty
|
||||
end,
|
||||
run = function(self)
|
||||
local docs = self.plugin.dir .. "/doc/"
|
||||
|
|
Loading…
Reference in New Issue