feat: plugins no longer need to be installed under site/pack/*/opt

This commit is contained in:
Folke Lemaitre 2022-12-03 15:48:06 +01:00
parent 37c7366ab0
commit dbe2d0942a
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
6 changed files with 14 additions and 20 deletions

View file

@ -147,7 +147,7 @@ end
function M.update_state()
---@type table<string,FileType>
local installed = {}
Util.ls(Config.root, function(_, name, type)
Util.ls(Config.options.root, function(_, name, type)
if type == "directory" or type == "link" then
installed[name] = type
end
@ -169,7 +169,7 @@ function M.update_state()
plugin.dir = plugin.uri
plugin._.installed = true -- user should make sure the directory exists
else
plugin.dir = Config.root .. "/" .. plugin.name
plugin.dir = Config.options.root .. "/" .. plugin.name
plugin._.installed = installed[plugin.name] ~= nil
installed[plugin.name] = nil
end
@ -179,7 +179,7 @@ function M.update_state()
for pack, dir_type in pairs(installed) do
table.insert(Config.to_clean, {
name = pack,
dir = Config.root .. "/" .. pack,
dir = Config.options.root .. "/" .. pack,
_ = {
installed = true,
is_symlink = dir_type == "link",