aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--eatit-cfg.lua9
-rw-r--r--eatit.lua16
2 files changed, 17 insertions, 8 deletions
diff --git a/eatit-cfg.lua b/eatit-cfg.lua
index 7d3eb76..dcdc95e 100644
--- a/eatit-cfg.lua
+++ b/eatit-cfg.lua
@@ -18,10 +18,11 @@ GNU General Public License for more details.
-- after being called with dofile()
plugins = { -- the plugins you want to load
- { 'https://git.squi.bid/eat-it',
- file = 'eatit.lua',
- dir = 'scripts',
- cfg = function()
+ { 'https://git.squi.bid/eat-it', -- required, specifies the git repo
+ file = 'eatit.lua', -- required, specifies the desired file
+ dir = 'scripts', -- optional, sets the dest dir
+ branch = 'master', -- optional, sets the desired branch
+ cfg = function() -- optional, runs code on mpv startup
print('this is an example')
end
},
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)