From be4063286a0b8f46754c082178517b3c684c3dff Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 31 Dec 2009 09:07:05 +0000 Subject: Allow appdir and libdir to be comma-separated lists of directories. --- app/acf_cli-controller.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/acf_cli-controller.lua') diff --git a/app/acf_cli-controller.lua b/app/acf_cli-controller.lua index ef82c70..3d4a3e9 100644 --- a/app/acf_cli-controller.lua +++ b/app/acf_cli-controller.lua @@ -5,13 +5,15 @@ require("posix") mvc = {} mvc.on_load = function (self, parent) -- Make sure we have some kind of sane defaults for libdir - self.conf.libdir = self.conf.libdir or ( posix.dirname(self.conf.appdir) .. "/lib/" ) + self.conf.libdir = self.conf.libdir or ( string.match(self.conf.appdir, "[^,]+/") .. "/lib/" ) self.conf.script = "" self.conf.default_prefix = "/acf-util/" self.conf.default_controller = "welcome" -- this sets the package path for us and our children - package.path= self.conf.libdir .. "?.lua;" .. package.path + for p in string.gmatch(self.conf.libdir, "[^,]+") do + package.path= p .. "?.lua;" .. package.path + end self.session = {} local x=require("session") -- cgit v1.2.3