mirror of https://github.com/folke/lazy.nvim.git
fix: show proper installed/clean state for local plugins
This commit is contained in:
parent
39c7e21c5f
commit
1e2f5273bb
|
@ -37,6 +37,8 @@ M.symlink = {
|
||||||
if stat then
|
if stat then
|
||||||
assert(stat.type == "link")
|
assert(stat.type == "link")
|
||||||
if vim.loop.fs_realpath(self.plugin.uri) == vim.loop.fs_realpath(self.plugin.dir) then
|
if vim.loop.fs_realpath(self.plugin.uri) == vim.loop.fs_realpath(self.plugin.dir) then
|
||||||
|
self.plugin._.installed = true
|
||||||
|
self.plugin._.cloned = true
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
vim.loop.fs_unlink(self.plugin.dir)
|
vim.loop.fs_unlink(self.plugin.dir)
|
||||||
|
@ -44,6 +46,8 @@ M.symlink = {
|
||||||
end
|
end
|
||||||
vim.loop.fs_symlink(self.plugin.uri, self.plugin.dir, { dir = true })
|
vim.loop.fs_symlink(self.plugin.uri, self.plugin.dir, { dir = true })
|
||||||
vim.opt.runtimepath:append(self.plugin.uri)
|
vim.opt.runtimepath:append(self.plugin.uri)
|
||||||
|
self.plugin._.installed = true
|
||||||
|
self.plugin._.cloned = true
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,7 @@ M.fetch = {
|
||||||
skip = function(plugin)
|
skip = function(plugin)
|
||||||
return not plugin._.installed or plugin._.is_local
|
return not plugin._.installed or plugin._.is_local
|
||||||
end,
|
end,
|
||||||
|
|
||||||
run = function(self)
|
run = function(self)
|
||||||
local args = {
|
local args = {
|
||||||
"fetch",
|
"fetch",
|
||||||
|
@ -124,6 +125,7 @@ M.checkout = {
|
||||||
skip = function(plugin)
|
skip = function(plugin)
|
||||||
return not plugin._.installed or plugin._.is_local
|
return not plugin._.installed or plugin._.is_local
|
||||||
end,
|
end,
|
||||||
|
|
||||||
---@param opts {lockfile?:boolean}
|
---@param opts {lockfile?:boolean}
|
||||||
run = function(self, opts)
|
run = function(self, opts)
|
||||||
local info = assert(Git.info(self.plugin.dir))
|
local info = assert(Git.info(self.plugin.dir))
|
||||||
|
|
Loading…
Reference in New Issue