Skip to content

Commit be15d9d

Browse files
folkekiritowu
authored andcommitted
fix(lazy): added error handling for bootstrap (nvim-lua#1001)
1 parent b496dba commit be15d9d

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
@@ -230,7 +230,10 @@ vim.api.nvim_create_autocmd('TermOpen', {
230230
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
231231
if not vim.loop.fs_stat(lazypath) then
232232
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
233-
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
233+
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
234+
if vim.v.shell_error ~= 0 then
235+
error('Error cloning lazy.nvim:\n' .. out)
236+
end
234237
end ---@diagnostic disable-next-line: undefined-field
235238
vim.opt.rtp:prepend(lazypath)
236239

0 commit comments

Comments
 (0)