diff --git a/lua/gopher/_utils/_health.lua b/lua/gopher/_utils/_health.lua new file mode 100644 index 0000000..5b12026 --- /dev/null +++ b/lua/gopher/_utils/_health.lua @@ -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, +} diff --git a/lua/gopher/_utils/init.lua b/lua/gopher/_utils/init.lua index 4786fd4..ccae1b5 100644 --- a/lua/gopher/_utils/init.lua +++ b/lua/gopher/_utils/init.lua @@ -20,23 +20,6 @@ return { return s:sub(1, n) 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 lvl string|integer notify = function(msg, lvl) diff --git a/lua/gopher/health.lua b/lua/gopher/health.lua index 963f0cf..f1cc979 100644 --- a/lua/gopher/health.lua +++ b/lua/gopher/health.lua @@ -1,5 +1,5 @@ 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 requried = "Gopher.nvim will not work without it!"