Skip to content

Commit

Permalink
chore: clean up healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Jul 8, 2024
1 parent dabbcd2 commit b522862
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions lua/neorg/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ return {
)
)
else
vim.health.ok(string.format("Module declaration `%s` is well-formed", key))
vim.health.ok(string.format("Module declaration for `%s` is well-formed", key))
end
end

Expand All @@ -71,32 +71,10 @@ return {

vim.health.info("Checking existence of dependencies...")

if pcall(require, "lazy") then
if not (pcall(require, "luarocks-nvim")) then
vim.health.error(
"Required dependency `vhyrro/luarocks.nvim` not found! Neither `theHamsta/nvim_rocks` nor `camspiers/luarocks` are compatible. Check installation instructions in the README for how to fix the error."
)
else
vim.health.ok("Required dependency `vhyrro/luarocks` found!")

vim.health.info("Checking existence of luarocks dependencies...")

local has_lua_utils = (pcall(require, "lua-utils"))

if not has_lua_utils then
vim.health.error(
"Critical dependency `lua-utils.nvim` not found! Please run `:Lazy build luarocks.nvim` and then `:Lazy build neorg`! Neorg will refuse to load."
)
else
vim.health.ok("Critical dependencies are installed. You are free to use Neorg!")
vim.health.warn("If you ever encounter errors please rerun `:Lazy build neorg` again :)")
end
end
if vim.fn.executable("luarocks") then
vim.health.ok("`luarocks` is installed.")
else
vim.health.ok("Using plugin manager other than lazy, no need for the `vhyrro/luarocks.nvim` dependency.")
vim.health.warn(
"If you are on an unsupported plugin manager you may still need the plugin for Neorg to function."
)
vim.health.error("`luarocks` not installed on your system! Please consult the Neorg README for installation instructions.")
end
end,
}

0 comments on commit b522862

Please sign in to comment.