Skip to content

Commit

Permalink
Documentation change
Browse files Browse the repository at this point in the history
Bootstrap script did not correctly identify if paq was installed
It also did not create the exit autocommand before the event could
trigger
  • Loading branch information
alukreis authored and savq committed Mar 2, 2023
1 parent 2d6c489 commit 295fbf1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/paq-nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ session. For example:
-- In ~/.config/nvim/init.lua
local function clone_paq()
local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim"
local is_installed = vim.fn.empty(vim.fn.glob(path)) > 0
local is_installed = vim.fn.empty(vim.fn.glob(path)) == 0

This comment has been minimized.

Copy link
@craigmac

craigmac Mar 20, 2023

Contributor

would this simpler version suffice?

local is_installed = vim.fn.isdirectory(path) == 1

especially if users changes install path, because glob() respects wildignore and people would naturally put pack/** in wildignore, and so the test here fails.

if not is_installed then
vim.fn.system { "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", path }
return true
Expand Down Expand Up @@ -430,12 +430,12 @@ in headless mode, adding an autocommand that closes `Neovim` when done.
-- ... write the same function definitions as above ...

local function headless_paq()
-- Set to exit nvim after installing plugins
vim.cmd("autocmd User PaqDoneInstall quit")
bootstrap_paq {
"savq/paq-nvim",
-- List your packages
}
-- Exit nvim after installing plugins
vim.cmd("autocmd User PaqDoneInstall quit")
end

return {
Expand Down

0 comments on commit 295fbf1

Please sign in to comment.