Skip to content

Commit 71e4b92

Browse files
committed
feat(api): return runner from manage operations
1 parent dda5c6c commit 71e4b92

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lua/lazy/manage/init.lua

+9-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ local M = {}
1010
---@field show? boolean
1111
---@field mode? string
1212
---@field plugins? LazyPlugin[]
13+
---@field concurrency? number
1314

1415
---@param ropts RunnerOpts
1516
---@param opts? ManagerOpts
@@ -20,7 +21,7 @@ function M.run(ropts, opts)
2021
ropts.plugins = opts.plugins
2122
end
2223

23-
ropts.concurrency = ropts.concurrency or Config.options.concurrency
24+
ropts.concurrency = ropts.concurrency or opts.concurrency or Config.options.concurrency
2425

2526
if opts.clear then
2627
M.clear()
@@ -52,7 +53,7 @@ end
5253

5354
---@param opts? ManagerOpts
5455
function M.install(opts)
55-
M.run({
56+
return M.run({
5657
pipeline = {
5758
"git.clone",
5859
"git.checkout",
@@ -69,7 +70,7 @@ end
6970
---@param opts? ManagerOpts|{lockfile?:boolean}
7071
function M.update(opts)
7172
opts = opts or {}
72-
M.run({
73+
return M.run({
7374
pipeline = {
7475
"git.branch",
7576
"git.fetch",
@@ -87,9 +88,10 @@ function M.update(opts)
8788
end)
8889
end
8990

91+
---@param opts? ManagerOpts
9092
function M.check(opts)
9193
opts = opts or {}
92-
M.run({
94+
return M.run({
9395
pipeline = {
9496
"git.fetch",
9597
"wait",
@@ -103,7 +105,7 @@ end
103105

104106
---@param opts? ManagerOpts
105107
function M.log(opts)
106-
M.run({
108+
return M.run({
107109
pipeline = { "git.log" },
108110
plugins = function(plugin)
109111
return plugin.uri and plugin._.installed
@@ -113,7 +115,7 @@ end
113115

114116
---@param opts? ManagerOpts
115117
function M.clean(opts)
116-
M.run({
118+
return M.run({
117119
pipeline = { "fs.clean" },
118120
plugins = Config.to_clean,
119121
}, opts)
@@ -122,6 +124,7 @@ end
122124
function M.clear()
123125
Plugin.load()
124126
for _, plugin in pairs(Config.plugins) do
127+
plugin._.has_updates = nil
125128
plugin._.updated = nil
126129
plugin._.cloned = nil
127130
plugin._.dirty = nil

0 commit comments

Comments
 (0)