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

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -