Skip to content

Commit 945cc2d

Browse files
fix(lazy): added error handling for bootstrap (nvim-lua#1001)
1 parent 05b53a1 commit 945cc2d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua/lazy-bootstrap.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
-- [[ Install `lazy.nvim` plugin manager ]]
22
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
33
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
4-
if not vim.uv.fs_stat(lazypath) then
4+
if not vim.loop.fs_stat(lazypath) then
55
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
6-
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
6+
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
7+
if vim.v.shell_error ~= 0 then
8+
error('Error cloning lazy.nvim:\n' .. out)
9+
end
710
end ---@diagnostic disable-next-line: undefined-field
811
vim.opt.rtp:prepend(lazypath)
912

0 commit comments

Comments
 (0)