Skip to content

Commit 16e5271

Browse files
committed
fix(plugin): check that path is actually in root dir. Closes #2075
1 parent 1ea3c40 commit 16e5271

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lua/lazy/core/plugin.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function M.update_state()
240240
if plugin.virtual then
241241
plugin._.is_local = true
242242
plugin._.installed = true -- local plugins are managed by the user
243-
elseif plugin.dir:find(Config.options.root, 1, true) == 1 then
243+
elseif plugin.dir:find(Config.options.root .. "/", 1, true) == 1 then
244244
plugin._.installed = installed[plugin.name] ~= nil
245245
installed[plugin.name] = nil
246246
else

lua/lazy/manage/task/fs.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ M.clean = {
2525
run = function(self, opts)
2626
opts = opts or {}
2727
local dir = self.plugin.dir:gsub("/+$", "")
28-
assert(dir:find(Config.options.root, 1, true) == 1, self.plugin.dir .. " should be under packpath!")
28+
assert(dir:find(Config.options.root .. "/", 1, true) == 1, self.plugin.dir .. " should be under packpath!")
2929

3030
local rock_root = Config.options.rocks.root .. "/" .. self.plugin.name
3131
if vim.uv.fs_stat(rock_root) then

0 commit comments

Comments
 (0)