refactor(utils): separete module for health
This commit is contained in:
parent
0b1d8fa7c2
commit
0b4e0b7449
3 changed files with 18 additions and 18 deletions
17
lua/gopher/_utils/_health.lua
Normal file
17
lua/gopher/_utils/_health.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
return {
|
||||||
|
---@param lib string
|
||||||
|
---@return boolean
|
||||||
|
lualib_is_found = function(lib)
|
||||||
|
local is_found, _ = pcall(require, lib)
|
||||||
|
return is_found
|
||||||
|
end,
|
||||||
|
|
||||||
|
---@param bin string
|
||||||
|
---@return boolean
|
||||||
|
binary_is_found = function(bin)
|
||||||
|
if vim.fn.executable(bin) == 1 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
@ -20,23 +20,6 @@ return {
|
||||||
return s:sub(1, n)
|
return s:sub(1, n)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
---@param lib string
|
|
||||||
---@return boolean
|
|
||||||
lualib_is_found = function(lib)
|
|
||||||
local is_found, _ = pcall(require, lib)
|
|
||||||
return is_found
|
|
||||||
end,
|
|
||||||
|
|
||||||
---@param bin string
|
|
||||||
---@return boolean
|
|
||||||
binary_is_found = function(bin)
|
|
||||||
if vim.fn.executable(bin) == 1 then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
return false
|
|
||||||
end,
|
|
||||||
|
|
||||||
---@param msg string
|
---@param msg string
|
||||||
---@param lvl string|integer
|
---@param lvl string|integer
|
||||||
notify = function(msg, lvl)
|
notify = function(msg, lvl)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
local health = vim.health or require "health"
|
local health = vim.health or require "health"
|
||||||
local utils = require "gopher._utils"
|
local utils = require "gopher._utils._health"
|
||||||
local c = require("gopher.config").config.commands
|
local c = require("gopher.config").config.commands
|
||||||
|
|
||||||
local requried = "Gopher.nvim will not work without it!"
|
local requried = "Gopher.nvim will not work without it!"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue