File tree 1 file changed +18
-11
lines changed
1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -4,25 +4,32 @@ local Util = require("lazy.util")
4
4
--- @type table<string , LazyTaskDef>
5
5
local M = {}
6
6
7
+ local function rm (dir )
8
+ local stat = vim .uv .fs_lstat (dir )
9
+ assert (stat and stat .type == " directory" , dir .. " should be a directory!" )
10
+ Util .walk (dir , function (path , _ , type )
11
+ if type == " directory" then
12
+ vim .uv .fs_rmdir (path )
13
+ else
14
+ vim .uv .fs_unlink (path )
15
+ end
16
+ end )
17
+ vim .uv .fs_rmdir (dir )
18
+ end
19
+
7
20
M .clean = {
8
21
skip = function (plugin )
9
22
return plugin ._ .is_local
10
23
end ,
11
24
run = function (self )
12
25
local dir = self .plugin .dir :gsub (" /+$" , " " )
13
26
assert (dir :find (Config .options .root , 1 , true ) == 1 , self .plugin .dir .. " should be under packpath!" )
27
+ rm (dir )
14
28
15
- local stat = vim .uv .fs_lstat (dir )
16
- assert (stat and stat .type == " directory" , self .plugin .dir .. " should be a directory!" )
17
-
18
- Util .walk (dir , function (path , _ , type )
19
- if type == " directory" then
20
- vim .uv .fs_rmdir (path )
21
- else
22
- vim .uv .fs_unlink (path )
23
- end
24
- end )
25
- vim .uv .fs_rmdir (dir )
29
+ local rock_root = Config .options .rocks .root .. " /" .. self .plugin .name
30
+ if vim .uv .fs_stat (rock_root ) then
31
+ rm (rock_root )
32
+ end
26
33
27
34
self .plugin ._ .installed = false
28
35
end ,
You can’t perform that action at this time.
0 commit comments