From 51fb95e4a89743670eb2ba710bcdb0e91834c3d4 Mon Sep 17 00:00:00 2001 From: WilliamHsieh Date: Sat, 31 Dec 2022 01:55:36 +0800 Subject: [PATCH] fix: duplicate state check in bootstrap (#255) --- README.md | 6 ++---- lua/lazy/init.lua | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7cce47d..f25fcfe 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,8 @@ 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 - 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 + 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 vim.opt.rtp:prepend(lazypath) ``` diff --git a/lua/lazy/init.lua b/lua/lazy/init.lua index 62783cc..cc6d2b3 100644 --- a/lua/lazy/init.lua +++ b/lua/lazy/init.lua @@ -68,10 +68,8 @@ end function M.bootstrap() local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - 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 + 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 vim.opt.rtp:prepend(lazypath) end