diff options
-rw-r--r-- | lua/dep.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lua/dep.lua b/lua/dep.lua index c6deb9f..378ef82 100644 --- a/lua/dep.lua +++ b/lua/dep.lua @@ -11,7 +11,7 @@ local logger = require("dep.log").global local proc = require("dep.proc") local initialized, perf, config_path, base_dir -local packages, root +local packages, root, load local function bench(name, code, ...) local start = os.clock() @@ -396,6 +396,16 @@ local function reload() end local function reload_all() + -- recall the load function + if load and type(load) == "function" then + local ok, ret = pcall(load) + if ok and type(ret) == "table" then + register_recursive(ret) + else + logger:log("error", ret) + end + end + for i = 1, #packages do local package = packages[i] package.loaded, package.subtree_loaded = false, false @@ -832,6 +842,7 @@ return setmetatable({ if config["load"] and type(config["load"]) == "function" then local ok, ret = pcall(config["load"]) if ok and type(ret) == "table" then + load = config["load"] register_recursive(ret) else logger:log("error", ret) |