Skip to content

Commit 51fb95e

Browse files
authored
fix: duplicate state check in bootstrap (#255)
1 parent 8d452e3 commit 51fb95e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ You can add the following Lua code to your `init.lua` to bootstrap **lazy.nvim**
3939
```lua
4040
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
4141
if not vim.loop.fs_stat(lazypath) then
42-
if not vim.loop.fs_stat(lazypath) then
43-
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
44-
vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release
45-
end
42+
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
43+
vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release
4644
end
4745
vim.opt.rtp:prepend(lazypath)
4846
```

lua/lazy/init.lua

+2-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@ end
6868
function M.bootstrap()
6969
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
7070
if not vim.loop.fs_stat(lazypath) then
71-
if not vim.loop.fs_stat(lazypath) then
72-
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
73-
vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release
74-
end
71+
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
72+
vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" }) -- last stable release
7573
end
7674
vim.opt.rtp:prepend(lazypath)
7775
end

0 commit comments

Comments
 (0)