From 0ca2926d83f4a677f7944a6e17414b2b9ee6878f Mon Sep 17 00:00:00 2001 From: garret Date: Sat, 26 Nov 2022 01:05:32 +0000 Subject: feedmaker: make it add its directory to the lua path so scripts can access the fake depctrl --- make-feed.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'make-feed.lua') 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: #### -- cgit v1.2.3-70-g09d2