mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 11:24:14 +00:00
fix: clean
This commit is contained in:
parent
35b1f98ac7
commit
7f4743ac30
6 changed files with 25 additions and 25 deletions
|
@ -1,5 +1,6 @@
|
|||
local Process = require("lazy.process")
|
||||
local Loader = require("lazy.loader")
|
||||
local Util = require("lazy.util")
|
||||
|
||||
---@class LazyTask
|
||||
---@field plugin LazyPlugin
|
||||
|
@ -39,16 +40,17 @@ function Task:clean()
|
|||
vim.loop.fs_unlink(entry.path)
|
||||
end
|
||||
end
|
||||
|
||||
vim.loop.fs_rmdir(path)
|
||||
end
|
||||
|
||||
local stat = vim.loop.fs_stat(self.plugin.dir)
|
||||
local dir = self.plugin.dir:gsub("/+$", "")
|
||||
|
||||
local stat = vim.loop.fs_lstat(dir)
|
||||
|
||||
if stat.type == "directory" then
|
||||
rm(self.plugin.dir)
|
||||
rm(dir)
|
||||
else
|
||||
vim.loop.fs_unlink(self.plugin.dir)
|
||||
vim.loop.fs_unlink(dir)
|
||||
end
|
||||
|
||||
self.plugin.installed = false
|
||||
|
@ -96,7 +98,6 @@ function Task:run()
|
|||
Loader.load(self.plugin)
|
||||
|
||||
local run = self.plugin.run
|
||||
|
||||
if run then
|
||||
if type(run) == "string" and run:sub(1, 1) == ":" then
|
||||
vim.cmd(run:sub(2))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue