From 3f6fabd3466ff14cc5e5dca8184963820ef2eb0f Mon Sep 17 00:00:00 2001 From: Squibid Date: Mon, 3 Jul 2023 15:55:14 -0400 Subject: allow user defined configs at startup and only reset logfile on startup --- eatit.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'eatit.lua') diff --git a/eatit.lua b/eatit.lua index c7053e4..b6939a1 100644 --- a/eatit.lua +++ b/eatit.lua @@ -157,7 +157,24 @@ local function initupdate() end closelog() +end + +-- run any user defined configs at startup +local function runopts() + openlog() + for i = 1, tablelength(plugins) do + if plugins[i]['cfg'] then + logwrite('Running ' .. plugins[i]['file'] .. '\'s config') + plugins[i]['cfg']() + end end + closelog() end +-- remove logfile on startup +openlog() +os.remove(fn) +closelog() + +runopts() mp.add_key_binding('U', 'UpdatePlugins', initupdate) -- cgit v1.2.1