add comments, change formatting on powerwash logging, ...
only remove log if logging is enabled
This commit is contained in:
16
eatit.lua
16
eatit.lua
@ -97,13 +97,17 @@ end
|
||||
|
||||
-- start install
|
||||
local function startinstall()
|
||||
-- let the user know that we are starting install
|
||||
logwrite('Starting Download...')
|
||||
mp.osd_message('Downloading plugins!')
|
||||
|
||||
-- start iterating through plugins
|
||||
for i = 1, tablelength(plugins) do
|
||||
-- check if the user has defined a file for the current plugin
|
||||
if not plugins[i]['file'] then
|
||||
logwrite('WARNING! Git repo "' .. plugins[i][1] ..
|
||||
'" doesn\'t have a specified file. Skipping download')
|
||||
|
||||
-- FIXME: this results in the last plugin being downloaded & copied twice
|
||||
i = i + 1 -- if not we go to the next plugin
|
||||
end
|
||||
@ -153,7 +157,7 @@ local function initupdate()
|
||||
|
||||
-- closing/removing everything
|
||||
if opts.dl.powerwash == true then
|
||||
logwrite('powerwashing the tmp dir (' .. opts.dl.dir .. ')')
|
||||
logwrite('powerwashing the tmp dir "' .. opts.dl.dir .. '"')
|
||||
os.execute('rm -rf ' .. opts.dl.dir)
|
||||
end
|
||||
|
||||
@ -161,6 +165,8 @@ local function initupdate()
|
||||
end
|
||||
|
||||
-- run any user defined configs at startup
|
||||
-- NOTE: This is kinda useless and might be removed if there is no way to make
|
||||
-- it run in the desired plugin's thread
|
||||
local function runopts()
|
||||
openlog()
|
||||
for i = 1, tablelength(plugins) do
|
||||
@ -173,9 +179,11 @@ local function runopts()
|
||||
end
|
||||
|
||||
-- remove logfile on startup
|
||||
openlog()
|
||||
os.remove(fn)
|
||||
closelog()
|
||||
if opts.logging.log then
|
||||
openlog()
|
||||
os.remove(fn)
|
||||
closelog()
|
||||
end
|
||||
|
||||
runopts()
|
||||
mp.add_key_binding(opts.bind, 'UpdatePlugins', initupdate)
|
||||
|
Reference in New Issue
Block a user