From 3d20ae8d2ac131aa2e2d2064c91ae31c800d8ea9 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sun, 30 Apr 2023 19:49:01 -0400 Subject: pin the correct repo to the top of the plugin list --- lua/dep.lua | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'lua/dep.lua') diff --git a/lua/dep.lua b/lua/dep.lua index dccd17b..20be24f 100644 --- a/lua/dep.lua +++ b/lua/dep.lua @@ -127,27 +127,6 @@ local function register_recursive(list, overrides) error(string.format("%s (spec=%s)", err, vim.inspect(list[i]))) end end - - if list.modules then - for i = 1, #list.modules do - local name, module = "", list.modules[i] - - if type(module) == "string" then - if list.modules.prefix then - module = list.modules.prefix .. module - end - - name, module = module, require(module) - end - - name = module.name or name - - local ok, err = pcall(register_recursive, module, overrides) - if not ok then - error(string.format("%s <- %s", err, name)) - end - end - end end local function sort_dependencies() @@ -851,6 +830,12 @@ return setmetatable({ bench("load", function() root = register("squibid/dep") register_recursive(config) + if config["load"] and type(config["load"]) == "function" then + local ok, ret = pcall(config["load"]()) + if ok and type(ret) == "table" then + register_recursive(ok) + end + end sort_dependencies() ensure_acyclic() end) -- cgit v1.2.1