allow user defined configs at startup and only reset logfile on startup
This commit is contained in:
19
eatit.lua
19
eatit.lua
@ -157,7 +157,24 @@ local function initupdate()
|
|||||||
end
|
end
|
||||||
|
|
||||||
closelog()
|
closelog()
|
||||||
end
|
|
||||||
end
|
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)
|
mp.add_key_binding('U', 'UpdatePlugins', initupdate)
|
||||||
|
Reference in New Issue
Block a user