Skip to content

Commit 0e106c0

Browse files
committed
ci(minit): added repro
1 parent b1821ca commit 0e106c0

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

lua/lazy/minit.lua

+38-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ function M.extend(defaults, opts)
2525
end
2626

2727
function M.setup(opts)
28-
opts = M.extend({ spec = { { dir = vim.fn.expand(".") } } }, opts)
28+
opts = M.extend({
29+
change_detection = { enabled = false },
30+
}, opts)
2931

3032
-- set stdpaths to use .tests
3133
local root = opts.stdpath or ".minit"
@@ -36,11 +38,45 @@ function M.setup(opts)
3638

3739
vim.o.loadplugins = true
3840
require("lazy").setup(opts)
41+
require("lazy").update():wait()
42+
if vim.bo.filetype == "lazy" then
43+
local errors = false
44+
for _, plugin in pairs(require("lazy.core.config").spec.plugins) do
45+
errors = errors or require("lazy.core.plugin").has_errors(plugin)
46+
end
47+
if not errors then
48+
vim.cmd.close()
49+
end
50+
end
51+
end
52+
53+
function M.repro(opts)
54+
opts = M.extend({
55+
spec = {
56+
{
57+
"folke/tokyonight.nvim",
58+
priority = 1000,
59+
lazy = false,
60+
config = function()
61+
require("tokyonight").setup({ style = "moon" })
62+
require("tokyonight").load()
63+
end,
64+
},
65+
},
66+
install = { colorscheme = { "tokyonight" } },
67+
}, opts)
68+
M.setup(opts)
3969
end
4070

4171
---@param opts LazyMinit
4272
function M.busted(opts)
43-
opts = M.extend({ spec = { "lunarmodules/busted" }, rocks = { hererocks = true } }, opts)
73+
opts = M.extend({
74+
spec = {
75+
"lunarmodules/busted",
76+
{ dir = vim.fn.fnamemodify(".", ":p") },
77+
},
78+
rocks = { hererocks = true },
79+
}, opts)
4480

4581
M.setup(opts)
4682

0 commit comments

Comments
 (0)