Diff

core/moduleapi.lua @ 7115:805d068d2fd5

modulemanager, util.pluginloader: Move logic for locating some module libraries to pluginloader, to fix problems with non-filesystem errors being masked by the second load_code call
author Matthew Wild <mwild1@gmail.com>
date Mon, 01 Feb 2016 21:26:15 +0000
parent 6779:6236668da30a
child 7116:ecba5fee4867
child 7127:27557dd7b460
line wrap: on
line diff
--- a/core/moduleapi.lua	Sun Jan 31 17:27:15 2016 +0100
+++ b/core/moduleapi.lua	Mon Feb 01 21:26:15 2016 +0000
@@ -135,10 +135,7 @@
 end
 
 function api:require(lib)
-	local f, n = pluginloader.load_code(self.name, lib..".lib.lua", self.environment);
-	if not f then
-		f, n = pluginloader.load_code(lib, lib..".lib.lua", self.environment);
-	end
+	local f, n = pluginloader.load_code_ext(self.name, lib, "lib.lua", self.environment);
 	if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message
 	return f();
 end