diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-11-29 03:28:07 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-11-29 03:28:07 +0000 |
commit | f03d1616f0b685bda23dfbe79d4d8cc7fd95fde5 (patch) | |
tree | 132e2f26bf8f64086adc5f75fc45a9921a1e5e4c /prosody | |
parent | e7cfd639687786d0426897f4706200818c66295a (diff) | |
parent | 7271c148cef981f9263a8794ebe27634423b07bd (diff) | |
download | prosody-f03d1616f0b685bda23dfbe79d4d8cc7fd95fde5.tar.gz prosody-f03d1616f0b685bda23dfbe79d4d8cc7fd95fde5.zip |
Automated merge with http://waqas.ath.cx/
Diffstat (limited to 'prosody')
-rwxr-xr-x | prosody | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -2,15 +2,32 @@ -- Config here -- - +CFG_SOURCEDIR=nil; +CFG_CONFIGDIR=nil; +CFG_PLUGINDIR=nil; -- -- -- -- -- -- if CFG_SOURCEDIR then + if os.getenv("HOME") then + CFG_SOURCEDIR = CFG_SOURCEDIR:gsub("^~", os.getenv("HOME")); + end package.path = CFG_SOURCEDIR.."/?.lua;"..package.path - package.cpath = CFG_SOURCEDIR.."/?.lua;"..package.cpath + package.cpath = CFG_SOURCEDIR.."/?.so;"..package.cpath end +if CFG_CONFIGDIR then + if os.getenv("HOME") then + CFG_CONFIGDIR = CFG_CONFIGDIR:gsub("^~", os.getenv("HOME")); + end +end + +if CFG_PLUGINDIR then + if os.getenv("HOME") then + CFG_PLUGINDIR = CFG_PLUGINDIR:gsub("^~", os.getenv("HOME")); + end +end + -- Required to be able to find packages installed with luarocks pcall(require, "luarocks.require") @@ -21,7 +38,7 @@ log = require "util.logger".init("general"); do -- TODO: Check for other formats when we add support for them -- Use lfs? Make a new conf/ dir? - local ok, err = config.load("lxmppd.cfg.lua"); + local ok, err = config.load((CFG_CONFIGDIR or ".").."/prosody.cfg.lua"); if not ok then log("error", "Couldn't load config file: %s", err); log("info", "Falling back to old config file format...") |