Skip to content

Commit fed4875

Browse files
committed
fix: deprecated opt healthcheck (resolves #105)
1 parent 36c2dce commit fed4875

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lua/gp/health.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function M.check()
6969
end
7070
end
7171

72-
if #gp._deprecated > 0 then
72+
if gp._deprecated and #gp._deprecated > 0 then
7373
local msg = "deprecated config option(s) in setup():"
7474
for _, v in ipairs(gp._deprecated) do
7575
msg = msg .. "\n\n- " .. v.msg

lua/gp/init.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ local M = {
3131
_handles = {}, -- handles for running processes
3232
_queries = {}, -- table of latest queries
3333
_state = {}, -- table of state variables
34+
_deprecated = {}, -- table of deprecated options
3435
agents = {}, -- table of agents
3536
image_agents = {}, -- table of image agents
3637
cmd = {}, -- default command functions
@@ -699,8 +700,6 @@ M.setup = function(opts)
699700
opts[tbl] = nil
700701
end
701702

702-
-- merge user opts to M.config
703-
M._deprecated = {}
704703
for k, v in pairs(opts) do
705704
if deprecated[k] then
706705
table.insert(M._deprecated, { name = k, msg = deprecated[k], value = v })

0 commit comments

Comments
 (0)