From c5bcf9d9a17ccb278138e8647343542b20cb5ae6 Mon Sep 17 00:00:00 2001 From: zbirenbaum Date: Sun, 29 May 2022 02:53:03 -0400 Subject: [PATCH] fix #1141 --- lua/core/packer.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/core/packer.lua b/lua/core/packer.lua index 3ee917e..e48a9cd 100644 --- a/lua/core/packer.lua +++ b/lua/core/packer.lua @@ -2,11 +2,13 @@ local M = {} M.bootstrap = function() local fn = vim.fn - local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" + local base_path = fn.stdpath "data" .. "/site/pack/packer" + local opt, start = base_path .. "/opt/packer.nvim", base_path .. "/start/packer.nvim" + local install_path = fn.isdirectory(opt) and opt or start vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#1e222a" }) - if fn.empty(fn.glob(install_path)) > 0 then + if not fn.isdirectory(install_path) then print "Cloning packer .." fn.system { "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path }