aboutsummaryrefslogtreecommitdiffstats
path: root/eatit.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2023-07-16 20:22:13 -0400
committerSquibid <me@zacharyscheiman.com>2023-07-16 20:22:13 -0400
commit2162b9cd2e0d307fed376f909c75db6c0afac217 (patch)
tree4179b716010cfebb71af36537190ceed3a67d217 /eatit.lua
parenta566b63fa56c4637ef76ecc01d2a470ecf836b46 (diff)
downloadeat-it-2162b9cd2e0d307fed376f909c75db6c0afac217.tar.gz
eat-it-2162b9cd2e0d307fed376f909c75db6c0afac217.tar.bz2
eat-it-2162b9cd2e0d307fed376f909c75db6c0afac217.zip
add comments, change formatting on powerwash logging, ...
only remove log if logging is enabled
Diffstat (limited to '')
-rw-r--r--eatit.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/eatit.lua b/eatit.lua
index 6bd70fe..353d72c 100644
--- a/eatit.lua
+++ b/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)