@@ -35,12 +35,13 @@ local function check()
3535 -- Get neovim version info
3636 local nvim_version = get_nvim_version ()
3737 if nvim_version .major > 0 or nvim_version .minor >= 10 then
38- utils . health_msg ( " ok " , " Neovim version: v" .. nvim_version .simple )
38+ health . ok ( " Neovim version: v" .. nvim_version .simple )
3939 elseif nvim_version .major == 0 and nvim_version .minor >= 9 then
40- utils . health_msg ( " warn" , " Neovim version: v" .. nvim_version .simple .. " (Deprecated)" )
40+ health . warn ( " Neovim version: v" .. nvim_version .simple .. " (Deprecated)" )
4141 else
42- utils . health_msg ( " error" , " Neovim version: v" .. nvim_version .simple .. " (Unsupported)" )
42+ health . error ( " Neovim version: v" .. nvim_version .simple .. " (Unsupported)" )
4343 end
44+
4445 -- Load user configuration
4546 local user_config = require (" nvim_updater" ).default_config or {}
4647 local source_dir = user_config .source_dir or " ~/.local/src/neovim"
@@ -49,42 +50,42 @@ local function check()
4950
5051 -- Directory Existence Check
5152 if fn .isdirectory (source_dir ) == 1 then
52- utils . health_msg ( " ok " , " Source directory exists: " .. source_dir )
53+ health . ok ( " Source directory exists: " .. source_dir )
5354
5455 -- Check that the plugin reflects the same
5556 if utils .directory_exists (source_dir ) then
56- utils . health_msg ( " ok " , " Source directory matches plugin directory: " .. source_dir )
57+ health . ok ( " Source directory matches plugin directory: " .. source_dir )
5758 else
58- utils . health_msg ( " warn" , " Source directory does not match plugin directory: " .. source_dir )
59+ health . warn ( " Source directory does not match plugin directory: " .. source_dir )
5960 end
6061
6162 -- Write permission check using temp file test if the directory exists
6263 if check_write_permissions (source_dir ) then
63- utils . health_msg ( " ok " , " Write access to source directory checked successfully" )
64+ health . ok ( " Write access to source directory checked successfully" )
6465 else
65- utils . health_msg ( " warn" , " No write access to source directory: " .. source_dir )
66- utils . health_msg ( " info" , " Hint: Run ':NVRemoveSource' to remove and retry with correct permissions." )
66+ health . warn ( " No write access to source directory: " .. source_dir )
67+ health . info ( " Hint: Run ':NVRemoveSource' to remove and retry with correct permissions." )
6768 end
6869 else
69- utils . health_msg ( " warn" , " Source directory does not exist: " .. source_dir )
70- utils . health_msg ( " info" , " Hint: Run ':NVCloneSource' to clone the Neovim source directory." )
70+ health . warn ( " Source directory does not exist: " .. source_dir )
71+ health . info ( " Hint: Run ':NVCloneSource' to clone the Neovim source directory." )
7172
7273 -- Parent directory write permissions check
7374 local parent_dir = fs .dirname (source_dir )
7475 if check_write_permissions (parent_dir ) then
75- utils . health_msg ( " ok " , " Write access to parent directory (" .. parent_dir .. " ) is available." )
76+ health . ok ( " Write access to parent directory (" .. parent_dir .. " ) is available." )
7677 else
77- utils . health_msg ( " error" , " No write access to parent directory: " .. parent_dir )
78- utils . health_msg ( " info" , " Hint: Adjust permissions or try a different 'source_dir'." )
78+ health . error ( " No write access to parent directory: " .. parent_dir )
79+ health . info ( " Hint: Adjust permissions or try a different 'source_dir'." )
7980 end
8081 end
8182
8283 -- Remote Branch Existence Check
8384 local git_output = fn .systemlist (" git ls-remote --heads https://github.com/neovim/neovim " .. branch )
8485 if fn .empty (git_output ) == 1 then
85- utils . health_msg ( " error" , " Branch '" .. branch .. " ' does not exist on the Neovim GitHub repo!" )
86+ health . error ( " Branch '" .. branch .. " ' does not exist on the Neovim GitHub repo!" )
8687 else
87- utils . health_msg ( " ok " , " Remote branch exists: " .. branch )
88+ health . ok ( " Remote branch exists: " .. branch )
8889 end
8990end
9091
0 commit comments