Skip to content

Commit 959a163

Browse files
folkeandreiblt1304
authored andcommitted
fix(lazy): added error handling for bootstrap (nvim-lua#1001)
1 parent 676582e commit 959a163

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
@@ -203,7 +203,10 @@ vim.api.nvim_create_autocmd('TextYankPost', {
203203
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
204204
if not vim.loop.fs_stat(lazypath) then
205205
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
206-
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
206+
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
207+
if vim.v.shell_error ~= 0 then
208+
error('Error cloning lazy.nvim:\n' .. out)
209+
end
207210
end ---@diagnostic disable-next-line: undefined-field
208211
vim.opt.rtp:prepend(lazypath)
209212

0 commit comments

Comments
 (0)