From b607bed6662bdc551b5918fd17b0c6cfb2d833e4 Mon Sep 17 00:00:00 2001 From: Alessio <148966056+alessio-locatelli@users.noreply.github.com> Date: Sat, 31 May 2025 21:31:25 +0300 Subject: [PATCH] fix: do not be silent on clone fail (#32) --- init.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index edcc092..a9bfbdb 100644 --- a/init.lua +++ b/init.lua @@ -1,10 +1,18 @@ -- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution -- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk. local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim" + if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) + local result = vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) + if vim.v.shell_error ~= 0 then + -- stylua: ignore + vim.api.nvim_echo({ { ("Error cloning lazy.nvim:\n%s\n"):format(result), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {}) + vim.fn.getchar() + vim.cmd.quit() + end end + vim.opt.rtp:prepend(lazypath) -- validate that lazy is available