mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 04:46:45 +00:00
build: better minit
This commit is contained in:
parent
923e1aa7a4
commit
a17ad27435
4 changed files with 67 additions and 26 deletions
|
@ -13,6 +13,10 @@ function M.setup()
|
|||
end
|
||||
end
|
||||
|
||||
if vim.env.LAZY_PATH and not vim.uv.fs_stat(vim.env.LAZY_PATH) then
|
||||
vim.env.LAZY_PATH = nil
|
||||
end
|
||||
|
||||
local lazypath = vim.env.LAZY_PATH or vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.env.LAZY_PATH and not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
vim.api.nvim_echo({
|
||||
|
@ -26,19 +30,12 @@ function M.setup()
|
|||
pcall(vim.fn.system, { "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if not ok or vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{
|
||||
"Failed to clone lazy.nvim\n",
|
||||
"ErrorMsg",
|
||||
},
|
||||
{
|
||||
vim.trim(out or ""),
|
||||
"WarningMsg",
|
||||
},
|
||||
{ "\nPress any key to exit", "MoreMsg" },
|
||||
{ "Failed to clone lazy.nvim\n", "ErrorMsg" },
|
||||
{ vim.trim(out or ""), "WarningMsg" },
|
||||
{ "\nPress any key to exit...", "MoreMsg" },
|
||||
}, true, {})
|
||||
|
||||
vim.fn.getchar()
|
||||
vim.cmd([[quit]])
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue