From de82a991971d20cfaaeb0d86802283e2ac4a4574 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 30 Dec 2022 14:46:18 +0100 Subject: [PATCH] fix(bootstrap): fixed bootstrap script --- README.md | 12 ++++-------- lua/lazy/init.lua | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 8137755..7cce47d 100644 --- a/README.md +++ b/README.md @@ -39,14 +39,10 @@ You can add the following Lua code to your `init.lua` to bootstrap **lazy.nvim** ```lua local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "--branch=stable", -- remove this if you want to bootstrap to HEAD - "https://github.com/folke/lazy.nvim.git", - lazypath, - }) + if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath }) + vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release + end end vim.opt.rtp:prepend(lazypath) ``` diff --git a/lua/lazy/init.lua b/lua/lazy/init.lua index ce21dfc..62783cc 100644 --- a/lua/lazy/init.lua +++ b/lua/lazy/init.lua @@ -68,14 +68,10 @@ end function M.bootstrap() local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "--branch=stable", -- remove this if you want to bootstrap to HEAD - "https://github.com/folke/lazy.nvim.git", - lazypath, - }) + if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath }) + vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release + end end vim.opt.rtp:prepend(lazypath) end