mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
update: if the required prerequisites are not installed, we need an early return.
This commit is contained in:
parent
507973278c
commit
7c758fd69e
1 changed files with 9 additions and 9 deletions
|
|
@ -28,13 +28,13 @@ return {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local errors = {}
|
|
||||||
local filetypes = {}
|
local filetypes = {}
|
||||||
|
|
||||||
-- Ensure all required prerequisites are installed
|
-- Ensure all required prerequisites are installed
|
||||||
for _, tool in ipairs(prerequisites.required) do
|
for _, tool in ipairs(prerequisites.required) do
|
||||||
if vim.fn.executable(tool.cmd) == 0 then
|
if vim.fn.executable(tool.cmd) == 0 then
|
||||||
table.insert(errors, "Required prerequisite not installed: " .. tool.name)
|
LazyVim.error("Required prerequisite not installed: " .. tool.name)
|
||||||
|
return
|
||||||
else
|
else
|
||||||
filetypes = vim.tbl_extend("force", filetypes, tool.filetypes)
|
filetypes = vim.tbl_extend("force", filetypes, tool.filetypes)
|
||||||
end
|
end
|
||||||
|
|
@ -50,7 +50,13 @@ return {
|
||||||
end
|
end
|
||||||
|
|
||||||
if not findCmd then
|
if not findCmd then
|
||||||
table.insert(errors, "None of the required 'find cmd' prerequisites are installed")
|
LazyVim.error(
|
||||||
|
"None of the required 'find cmd' prerequisites is installed.\n"
|
||||||
|
.. "Please install at least one of the following: `rd`, `rg`, or `find`.\n"
|
||||||
|
.. "More information can be found at: "
|
||||||
|
.. "https://github.com/nvim-telescope/telescope-media-files.nvim?tab=readme-ov-file#prerequisites"
|
||||||
|
)
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check optional prerequisites and include their filetypes if installed
|
-- Check optional prerequisites and include their filetypes if installed
|
||||||
|
|
@ -60,12 +66,6 @@ return {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- If one of required prerequisites not installed print them and return
|
|
||||||
if #errors > 0 then
|
|
||||||
LazyVim.error(table.concat(errors, "\n"))
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Setup media_files extension for telescope
|
-- Setup media_files extension for telescope
|
||||||
LazyVim.on_load("telescope.nvim", function()
|
LazyVim.on_load("telescope.nvim", function()
|
||||||
local ok, err = pcall(require("telescope").load_extension, "media_files")
|
local ok, err = pcall(require("telescope").load_extension, "media_files")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue