Headless updates with mini.deps #1676
-
Contributing guidelines
Module(s)mini.deps QuestionI have an update script that updates various packages, etc. on MacOS. I would like to also update Neovim plugins. To do this I currently run: nvim --headless -c +'lua MiniDeps.update(nil, { force = true })' +TSUpdateSync +qa However this doesn't seem to do the trick. It downloads the updates but doesn't seem to install them. When I run this and run Is it possible doing headless updates? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I am not sure if this is easily possible. The overall update process was designed to be non-blocking, so maybe this is a major road block here. I'll have to take a closer look. |
Beta Was this translation helpful? Give feedback.
-
Running this exact command seems to have worked for me: nvim --headless -c +'lua MiniDeps.update(nil, { force = true })' +TSUpdateSync +qa The trick here is that it only updates plugins which are currently added to the session (with default Running that command did take some time (as usual as with interactive "in-session" update) and indeed updated plugins that were loaded with
Let's check this more thoroughly:
|
Beta Was this translation helpful? Give feedback.
If anything, it should be
MiniDeps.later()
instead ofvim.schedule()
.Only hacky workaround, I am afraid. After trial and error, something like this should work:
nvim --headless -c +"lua MiniDeps.later(function() MiniDeps.update(nil, { force = true }); vim.cmd('TSUpdateSync'); vim.cmd('qa') end); vim.wait(30000)"
What it does:
later()
callback (which should be executed after alllater()
callbacks from the 'init.lua') and asks Neovim to wait for 30 …