aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-05-09 19:59:49 +0200
committerKim Alvefur <zash@zash.se>2014-05-09 19:59:49 +0200
commiteeacb3cb6ff5510cb5af8ea2c622783562ced91c (patch)
tree52a3a79d262465867fa53bbed14302279d0584ca
parent92ed3576fcc5381d2e9a97688b2d337626ad6a3d (diff)
downloadprosody-eeacb3cb6ff5510cb5af8ea2c622783562ced91c.tar.gz
prosody-eeacb3cb6ff5510cb5af8ea2c622783562ced91c.zip
configmanager: Delay importing LuaFileSystem until needed by an Include line
-rw-r--r--core/configmanager.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/configmanager.lua b/core/configmanager.lua
index d73bafa4..d175b54b 100644
--- a/core/configmanager.lua
+++ b/core/configmanager.lua
@@ -14,7 +14,7 @@ local format, math_max = string.format, math.max;
local fire_event = prosody and prosody.events.fire_event or function () end;
local envload = require"util.envload".envload;
-local lfs = require "lfs";
+local deps = require"util.dependencies";
local path_sep = package.config:sub(1,1);
module "configmanager"
@@ -214,6 +214,10 @@ do
function env.Include(file)
if file:match("[*?]") then
+ local lfs = deps.softreq "lfs";
+ if not lfs then
+ error(format("Error expanding wildcard pattern in Include %q - LuaFileSystem not available", file));
+ end
local path_pos, glob = file:match("()([^"..path_sep.."]+)$");
local path = file:sub(1, math_max(path_pos-2,0));
local config_path = config_file:gsub("[^"..path_sep.."]+$", "");