Skip to content

Commit

Permalink
fix: show proper installed/clean state for local plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 30, 2022
1 parent 39c7e21 commit 1e2f527
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/lazy/manage/task/fs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ M.symlink = {
if stat then
assert(stat.type == "link")
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
else
vim.loop.fs_unlink(self.plugin.dir)
end
end
vim.loop.fs_symlink(self.plugin.uri, self.plugin.dir, { dir = true })
vim.opt.runtimepath:append(self.plugin.uri)
self.plugin._.installed = true
self.plugin._.cloned = true
end,
}

Expand Down
2 changes: 2 additions & 0 deletions lua/lazy/manage/task/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ M.fetch = {
skip = function(plugin)
return not plugin._.installed or plugin._.is_local
end,

run = function(self)
local args = {
"fetch",
Expand All @@ -124,6 +125,7 @@ M.checkout = {
skip = function(plugin)
return not plugin._.installed or plugin._.is_local
end,

---@param opts {lockfile?:boolean}
run = function(self, opts)
local info = assert(Git.info(self.plugin.dir))
Expand Down

0 comments on commit 1e2f527

Please sign in to comment.