-
What would be the preferred way to autoupdate the mason packages? |
Beta Was this translation helpful? Give feedback.
Answered by
yutkat
Apr 23, 2023
Replies: 2 comments
-
I think that kind of functionality is not provided. I think it's most common to use You can create a command like this for simple automatic updates. vim.api.nvim_create_user_command("MasonUpgrade", function()
local registry = require("mason-registry")
registry.refresh()
registry.update()
local packages = registry.get_all_packages()
for _, pkg in ipairs(packages) do
if pkg:is_installed() then
pkg:install()
end
end
vim.cmd("doautocmd User MasonUpgradeComplete")
end, { force = true }) Execute this command periodically by cron or something. nvim --headless -c "autocmd User MasonUpgradeComplete sleep 100m | qall" -c 'MasonUpgrade' |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Jendker
-
That helps, thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think that kind of functionality is not provided. I think it's most common to use
:Mason
commands and typeU
instead of automatically updating it.You can create a command like this for simple automatic updates.
Execute this command periodically by cron or something.