Skip to content

Commit b1cc90b

Browse files
folkeMatthew Lemon
authored andcommitted
fix(lazy): added error handling for bootstrap (nvim-lua#1001)
1 parent beeca25 commit b1cc90b

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
@@ -234,7 +234,10 @@ vim.api.nvim_create_autocmd('TextYankPost', {
234234
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
235235
if not vim.loop.fs_stat(lazypath) then
236236
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
237-
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
237+
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
238+
if vim.v.shell_error ~= 0 then
239+
error('Error cloning lazy.nvim:\n' .. out)
240+
end
238241
end ---@diagnostic disable-next-line: undefined-field
239242
vim.opt.rtp:prepend(lazypath)
240243

0 commit comments

Comments
 (0)