core.modulemanager, core.moduleapi: Hack around dependency loop

This commit is contained in:
Kim Alvefur 2014-09-17 14:48:49 +02:00
parent a36064641e
commit 93a297bc8f
2 changed files with 6 additions and 3 deletions

View file

@ -7,7 +7,7 @@
-- --
local config = require "core.configmanager"; local config = require "core.configmanager";
local modulemanager = require "modulemanager"; -- This is necessary to avoid require loops local modulemanager; -- This gets set from modulemanager
local array = require "util.array"; local array = require "util.array";
local set = require "util.set"; local set = require "util.set";
local logger = require "util.logger"; local logger = require "util.logger";
@ -370,4 +370,7 @@ function api:open_store(name, type)
return require"core.storagemanager".open(self.host, name or self.name, type); return require"core.storagemanager".open(self.host, name or self.name, type);
end end
return api; return function (mm)
modulemanager = mm;
return api;
end

View file

@ -37,7 +37,7 @@ local _G = _G;
module "modulemanager" module "modulemanager"
local api = _G.require "core.moduleapi"; -- Module API container local api = _G.require "core.moduleapi"(_M); -- Module API container
-- [host] = { [module] = module_env } -- [host] = { [module] = module_env }
local modulemap = { ["*"] = {} }; local modulemap = { ["*"] = {} };