diff options
author | garret <garret@airmail.cc> | 2022-11-26 01:05:32 +0000 |
---|---|---|
committer | garret <garret@airmail.cc> | 2022-11-26 01:05:32 +0000 |
commit | 0ca2926d83f4a677f7944a6e17414b2b9ee6878f (patch) | |
tree | 6c365188933333112f2aec4aea1c35bcee431b03 /make-feed.lua | |
parent | 409ca1f18a5d6c1bc1f96224508a1437d97f3ed0 (diff) | |
download | depctrl-feedmaker-0ca2926d83f4a677f7944a6e17414b2b9ee6878f.tar.gz depctrl-feedmaker-0ca2926d83f4a677f7944a6e17414b2b9ee6878f.tar.bz2 depctrl-feedmaker-0ca2926d83f4a677f7944a6e17414b2b9ee6878f.zip |
feedmaker: make it add its directory to the lua path
so scripts can access the fake depctrl
Diffstat (limited to 'make-feed.lua')
-rwxr-xr-x | make-feed.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/make-feed.lua b/make-feed.lua index 77faa41..4faf0b0 100755 --- a/make-feed.lua +++ b/make-feed.lua @@ -12,6 +12,13 @@ local args = {macros = "/home/g/subs/automation-scripts/macros", modules = "/ho local config = loadfile(args.config)() +local function script_path() + local str = debug.getinfo(2, "S").source:sub(2) + return str:match("(.*/)") +end + +package.path = script_path() .. "?.lua;" .. package.path -- add the script dir to the lua path so scripts can access the fake depctrl + local function valid_namespace(name) --[[ #### Rules for a valid namespace: #### |