@@ -22,6 +22,8 @@ M.dirty = false
22
22
--- @field tasks ? LazyTask[]
23
23
--- @field dirty ? boolean
24
24
--- @field updated ? { from : string , to : string }
25
+ --- @field is_local ? boolean
26
+ --- @field is_symlink ? boolean
25
27
26
28
--- @class LazyPluginRef
27
29
--- @field branch ? string
@@ -124,12 +126,12 @@ function Spec.revive(spec)
124
126
end
125
127
126
128
function M .update_state (check_clean )
127
- --- @type table< " opt" | " start" , table<string,boolean >>
129
+ --- @type table< " opt" | " start" , table<string,FileType >>
128
130
local installed = { opt = {}, start = {} }
129
131
for opt , packs in pairs (installed ) do
130
132
Util .ls (Config .options .package_path .. " /" .. opt , function (_ , name , type )
131
133
if type == " directory" or type == " link" then
132
- packs [name ] = true
134
+ packs [name ] = type
133
135
end
134
136
end )
135
137
end
@@ -140,8 +142,12 @@ function M.update_state(check_clean)
140
142
plugin .opt = plugin .opt == nil and Config .options .opt or plugin .opt
141
143
local opt = plugin .opt and " opt" or " start"
142
144
plugin .dir = Config .options .package_path .. " /" .. opt .. " /" .. plugin .name
143
- plugin ._ .installed = installed [opt ][plugin .name ] == true
144
- installed [opt ][plugin .name ] = nil
145
+ plugin ._ .is_local = plugin .uri :sub (1 , 4 ) ~= " http" and plugin .uri :sub (1 , 3 ) ~= " git"
146
+ plugin ._ .is_symlink = installed [opt ][plugin .name ] == " link"
147
+ plugin ._ .installed = installed [opt ][plugin .name ] ~= nil
148
+ if plugin ._ .is_local == plugin ._ .is_symlink then
149
+ installed [opt ][plugin .name ] = nil
150
+ end
145
151
end
146
152
147
153
if check_clean then
@@ -153,7 +159,9 @@ function M.update_state(check_clean)
153
159
pack = pack ,
154
160
dir = Config .options .package_path .. " /" .. opt .. " /" .. pack ,
155
161
opt = opt == " opt" ,
156
- installed = true ,
162
+ _ = {
163
+ installed = true ,
164
+ },
157
165
})
158
166
end
159
167
end
0 commit comments