it's working now, but some of the logging is very redundant
This commit is contained in:
@ -193,7 +193,7 @@ return function(opts)
|
||||
M.registertree(opts)
|
||||
|
||||
-- sort package dependencies
|
||||
for _, package in pairs(root.get_packages()) do
|
||||
for _, package in pairs(packager.get_packages()) do
|
||||
table.sort(package.requirements, comp)
|
||||
table.sort(package.dependents, comp)
|
||||
end
|
||||
|
@ -265,7 +265,7 @@ function package:new(spec, overrides)
|
||||
|
||||
-- if the current package isn't the root package then it depends on the root
|
||||
-- package
|
||||
if root and package ~= root then
|
||||
if root and o ~= root then
|
||||
o:link_dependency(root, o)
|
||||
elseif not root then
|
||||
root = o
|
||||
@ -383,6 +383,7 @@ function package:ensureadded(force)
|
||||
self:runhooks("on_setup")
|
||||
|
||||
-- trigger the packadd for the plugin
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
local ok, err = pcall(vim.cmd, "packadd "..pkg.name)
|
||||
if not ok then
|
||||
return false, err
|
||||
@ -437,16 +438,19 @@ end
|
||||
---@return boolean boolean if tree was successfully loaded
|
||||
function package:loadtree(force)
|
||||
if not self.exists or not self.enabled then
|
||||
logger:log("load", "package %s doesn't exist or is not enabled", self.id)
|
||||
return false
|
||||
end
|
||||
|
||||
if self.subtree_loaded then
|
||||
logger:log("load", "package %s's subtree is already loaded", self.id)
|
||||
return true
|
||||
end
|
||||
|
||||
if not self.lazy then
|
||||
for _, requirement in pairs(self.requirements) do
|
||||
if not requirement.loaded then
|
||||
logger:log("load", "package %s requires %s to be loaded first", self.id, requirement.id)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user