Skip to content

Commit c4bf3ab

Browse files
folkeangerborn
authored andcommitted
fix(lazy): added error handling for bootstrap (nvim-lua#1001)
1 parent ace8f5c commit c4bf3ab

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
@@ -209,7 +209,10 @@ vim.api.nvim_create_autocmd('TextYankPost', {
209209
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
210210
if not vim.loop.fs_stat(lazypath) then
211211
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
212-
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
212+
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
213+
if vim.v.shell_error ~= 0 then
214+
error('Error cloning lazy.nvim:\n' .. out)
215+
end
213216
end ---@diagnostic disable-next-line: undefined-field
214217
vim.opt.rtp:prepend(lazypath)
215218

0 commit comments

Comments
 (0)