Skip to content

Commit

Permalink
fix(health): do not produce duplicated messages when there are no err…
Browse files Browse the repository at this point in the history
…ors in the `rocks.toml` file
  • Loading branch information
NTBBloodbath authored and teto committed Jun 28, 2024
1 parent 8fe399c commit cf2fdee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/rocks/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,21 @@ end

local function check_rocks_toml()
start("Checking rocks.toml")
local found_err = false
local success, user_rocks_or_err = xpcall(require("rocks.config.internal").get_user_rocks, function(err)
error(err)
found_err = true
end)
if not success then
return
end
for rock_name, _ in pairs(user_rocks_or_err) do
if rock_name:lower() ~= rock_name then
error(("Plugin name is not lowercase: %s"):format(rock_name))
found_err = true
end
end
if not found_err then
ok("No errors found in rocks.toml.")
end
end
Expand Down

0 comments on commit cf2fdee

Please sign in to comment.