Skip to content

Commit 83b6c04

Browse files
folkeZsmith32
authored andcommitted
fix(lazy): added error handling for bootstrap (nvim-lua#1001)
1 parent 7770e72 commit 83b6c04

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
@@ -145,7 +145,10 @@ vim.api.nvim_create_autocmd('TextYankPost', {
145145
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
146146
if not vim.loop.fs_stat(lazypath) then
147147
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
148-
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
148+
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
149+
if vim.v.shell_error ~= 0 then
150+
error('Error cloning lazy.nvim:\n' .. out)
151+
end
149152
end ---@diagnostic disable-next-line: undefined-field
150153
vim.opt.rtp:prepend(lazypath)
151154

0 commit comments

Comments
 (0)