mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-28 22:08:12 +02:00
fix: use correct install path for packer (#1540)
This commit is contained in:
parent
bb130d669b
commit
414777077f
2 changed files with 4 additions and 2 deletions
|
@ -72,6 +72,7 @@ function M:init()
|
||||||
cache_path = self.cache_path,
|
cache_path = self.cache_path,
|
||||||
runtime_dir = self.runtime_dir,
|
runtime_dir = self.runtime_dir,
|
||||||
config_dir = self.config_dir,
|
config_dir = self.config_dir,
|
||||||
|
install_path = join_paths(self.runtime_dir, "site", "pack", "packer", "start", "packer.nvim"),
|
||||||
package_root = join_paths(self.runtime_dir, "site", "pack"),
|
package_root = join_paths(self.runtime_dir, "site", "pack"),
|
||||||
compile_path = join_paths(self.config_dir, "plugin", "packer_compiled.lua"),
|
compile_path = join_paths(self.config_dir, "plugin", "packer_compiled.lua"),
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,12 @@ local plugin_loader = {}
|
||||||
function plugin_loader:init(opts)
|
function plugin_loader:init(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
|
local install_path = opts.install_path or vim.fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim"
|
||||||
local package_root = opts.package_root or vim.fn.stdpath "data" .. "/site/pack"
|
local package_root = opts.package_root or vim.fn.stdpath "data" .. "/site/pack"
|
||||||
local compile_path = opts.compile_path or vim.fn.stdpath "config" .. "/plugin/packer_compile.lua"
|
local compile_path = opts.compile_path or vim.fn.stdpath "config" .. "/plugin/packer_compile.lua"
|
||||||
|
|
||||||
if vim.fn.empty(vim.fn.glob(package_root)) > 0 then
|
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||||
vim.fn.system { "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", package_root }
|
vim.fn.system { "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path }
|
||||||
vim.cmd "packadd packer.nvim"
|
vim.cmd "packadd packer.nvim"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue