aboutsummaryrefslogtreecommitdiff
path: root/lua/muwiki/health.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/muwiki/health.lua')
-rw-r--r--lua/muwiki/health.lua33
1 files changed, 2 insertions, 31 deletions
diff --git a/lua/muwiki/health.lua b/lua/muwiki/health.lua
index 22c9747..13c5523 100644
--- a/lua/muwiki/health.lua
+++ b/lua/muwiki/health.lua
@@ -1,15 +1,5 @@
-
-local utils = require('muwiki.utils')
-
local M = {}
-local function command_exists(cmd)
- if type(cmd) == 'function' then
- return true
- end
- return vim.fn.executable(cmd) == 1
-end
-
M.check = function()
vim.health.start('Wiki Setup')
@@ -26,7 +16,8 @@ M.check = function()
vim.health.info('Add to your config: dirs = {{name = "default", path = "~/wiki"}}')
else
for _, dir in ipairs(cfg.dirs) do
- if utils.dir_exists(dir.path) then
+ local stat = vim.uv.fs_stat(dir.path)
+ if stat and stat.type == 'directory' then
vim.health.ok(string.format("Wiki '%s': %s", dir.name, dir.path))
else
vim.health.warn(string.format("Wiki '%s': %s (not found)", dir.name, dir.path))
@@ -34,26 +25,6 @@ M.check = function()
end
end
- vim.health.start('External Handlers')
-
- if cfg.use_external_handlers then
- vim.health.ok('External handlers are enabled')
-
- for _, handler in ipairs(cfg.external_handlers) do
- if type(handler.cmd) == 'function' then
- vim.health.ok(string.format("Handler '%s': <Lua function>", handler.name))
- elseif command_exists(handler.cmd) then
- vim.health.ok(string.format("Handler '%s': %s", handler.name, handler.cmd))
- else
- vim.health.error(
- string.format("Handler '%s': command not found (%s)", handler.name, handler.cmd)
- )
- end
- end
- else
- vim.health.info('External handlers are disabled')
- end
-
vim.health.start('Treesitter (Required)')
local has_ts_parser = pcall(vim.treesitter.get_parser, 0, 'markdown')