From 3967ba0346593b5ad18810caaa3b773a8e9c48c6 Mon Sep 17 00:00:00 2001 From: chrox Date: Mon, 23 Jun 2014 22:11:12 +0800 Subject: [PATCH] sort plugins in path order --- frontend/apps/reader/pluginloader.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/apps/reader/pluginloader.lua b/frontend/apps/reader/pluginloader.lua index a06fabc0d..ef26ce20d 100644 --- a/frontend/apps/reader/pluginloader.lua +++ b/frontend/apps/reader/pluginloader.lua @@ -19,7 +19,7 @@ function PluginLoader:loadPlugins() local package_cpath = package.cpath package.path = path.."/?.lua;"..package.path package.cpath = path.."/lib/?.so;"..package.cpath - local ok, module = pcall(require, "main") + local ok, module = pcall(dofile, mainfile) if not ok then DEBUG("Error when loading", mainfile, module) end @@ -37,6 +37,8 @@ function PluginLoader:loadPlugins() package.cpath = package.cpath..";"..plugin.path.."/lib/?.so" end + table.sort(self.plugins, function(v1,v2) return v1.path < v2.path end) + return self.plugins end