mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
fix(git): properly deal with failed clones. Fixes #571
This commit is contained in:
parent
5af93806aa
commit
77223786aa
3 changed files with 22 additions and 0 deletions
|
@ -188,6 +188,8 @@ function M.setup(opts)
|
|||
M.options.lockfile = Util.norm(M.options.lockfile)
|
||||
M.options.readme.root = Util.norm(M.options.readme.root)
|
||||
|
||||
vim.fn.mkdir(M.options.root, "p")
|
||||
|
||||
if M.options.performance.reset_packpath then
|
||||
vim.go.packpath = vim.env.VIMRUNTIME
|
||||
end
|
||||
|
|
|
@ -308,14 +308,24 @@ function Spec:merge(old, new)
|
|||
end
|
||||
|
||||
function M.update_state()
|
||||
---@type string[]
|
||||
local cloning = {}
|
||||
|
||||
---@type table<string,FileType>
|
||||
local installed = {}
|
||||
Util.ls(Config.options.root, function(_, name, type)
|
||||
if type == "directory" and name ~= "readme" then
|
||||
installed[name] = type
|
||||
elseif type == "file" and name:sub(-8) == ".cloning" then
|
||||
name = name:sub(1, -9)
|
||||
cloning[#cloning + 1] = name
|
||||
end
|
||||
end)
|
||||
|
||||
for _, failed in ipairs(cloning) do
|
||||
installed[failed] = nil
|
||||
end
|
||||
|
||||
for _, plugin in pairs(Config.plugins) do
|
||||
plugin._ = plugin._ or {}
|
||||
if plugin.lazy == nil then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue