Skip to content

Commit 82eef18

Browse files
author
jghauser
committed
feat(health): add check for papis-storage
1 parent 8c6d53b commit 82eef18

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

lua/papis/health.lua

+23
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,28 @@ reports["fs-watcher"] = function()
7777
end
7878
end
7979

80+
---Creates a report for papis-storage
81+
reports["papis-storage"] = function()
82+
local yq = config.yq_bin
83+
local yq_is_executable = vim.fn.executable(yq)
84+
85+
health.start("Papis storage")
86+
if yq_is_executable then
87+
health.info(string.format("The '%s' executable was found in path.", yq))
88+
local yq_version = vim.fn.system(yq .. " --version")
89+
local is_yq_go = string.find(yq_version, "mikefarah")
90+
if is_yq_go then
91+
health.ok(string.format("The go version of the '%s' executable was found in path.", yq))
92+
else
93+
health.error(string.format("The python version of the '%s' executable was not found in path.", yq))
94+
end
95+
else
96+
health.error(string.format("The '%s' executable was not found in path.", yq))
97+
end
98+
end
99+
end
100+
end
101+
80102
local M = {}
81103

82104
---Main function called by checkhealth
@@ -85,6 +107,7 @@ M.check = function()
85107
health = vim.health
86108
end
87109

110+
reports["papis-storage"]()
88111
reports["sqlite-wrapper"]()
89112
if config.enable_fs_watcher then
90113
reports["fs-watcher"]()

0 commit comments

Comments
 (0)