Skip to content

Commit 3f8625c

Browse files
folkeBartosz Sadowski
authored andcommitted
fix(lazy): added error handling for bootstrap (nvim-lua#1001)
1 parent 83fd3e9 commit 3f8625c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ vim.api.nvim_create_autocmd('TextYankPost', {
216216
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
217217
if not vim.loop.fs_stat(lazypath) then
218218
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
219-
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
219+
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
220+
if vim.v.shell_error ~= 0 then
221+
error('Error cloning lazy.nvim:\n' .. out)
222+
end
220223
end ---@diagnostic disable-next-line: undefined-field
221224
vim.opt.rtp:prepend(lazypath)
222225

0 commit comments

Comments
 (0)