import - Lua: Include file in the same directory -
i'm using imapfilter, , i'd keep global configuration in public repository, while keeping local (and secret) configuration in separate file. i'm running imapfilter
directory, includes ~/.imapfilter/config.lua, , that should include ./config_local.lua, "." directory of config.lua, not shell $pwd
or location of imapfilter
. here's i've tried far:
require "config_local" require "./config_local"
edit: absolute path works:
dofile(os.getenv("home") .. "/.imapfilter/config_local.lua")
not elegant, @ least it's compatible cron
.
add path package.path
.
something (not tested):
package.path = package.path .. ";" .. os.getenv("home") .. "/.imapfilter/?.lua"
Comments
Post a Comment