fix(health): cp nvim health checkup

This commit is contained in:
Barrett Ruth 2025-09-12 18:15:10 -05:00
parent bdb0703986
commit 9b30ceed95

View file

@ -23,7 +23,7 @@ end
local function check_python_env()
local plugin_path = debug.getinfo(1, "S").source:sub(2)
plugin_path = vim.fn.fnamemodify(plugin_path, ":h:h:h:h")
plugin_path = vim.fn.fnamemodify(plugin_path, ":h:h:h")
local venv_dir = plugin_path .. "/.venv"
if vim.fn.isdirectory(venv_dir) == 1 then
@ -35,7 +35,7 @@ end
local function check_scrapers()
local plugin_path = debug.getinfo(1, "S").source:sub(2)
plugin_path = vim.fn.fnamemodify(plugin_path, ":h:h:h:h")
plugin_path = vim.fn.fnamemodify(plugin_path, ":h:h:h")
local scrapers = { "atcoder.py", "codeforces.py", "cses.py" }
for _, scraper in ipairs(scrapers) do
@ -59,24 +59,6 @@ local function check_luasnip()
end
end
local function check_directories()
local cwd = vim.fn.getcwd()
local build_dir = cwd .. "/build"
local io_dir = cwd .. "/io"
if vim.fn.isdirectory(build_dir) == 1 then
vim.health.ok("Build directory exists: " .. build_dir)
else
vim.health.info("Build directory will be created when needed")
end
if vim.fn.isdirectory(io_dir) == 1 then
vim.health.ok("IO directory exists: " .. io_dir)
else
vim.health.info("IO directory will be created when needed")
end
end
local function check_config()
local cp = require("cp")
if cp.is_initialized() then
@ -100,7 +82,6 @@ function M.check()
check_python_env()
check_scrapers()
check_luasnip()
check_directories()
check_config()
end