Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(readme): make bootstrap snippet work well with lua-language-server #617

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ one may use the bootstrapping script. Place the following script into your `init
```lua
do
-- Specifies where to install/use rocks.nvim
local install_location = vim.fs.joinpath(vim.fn.stdpath("data"), "rocks")
local install_location = vim.fs.joinpath(vim.fn.stdpath("data") --[[@as string]], "rocks")

-- Set up configuration options related to rocks.nvim (recommended to leave as default)
local rocks_config = {
Expand Down Expand Up @@ -253,22 +253,17 @@ end

-- If rocks.nvim is not installed then install it!
if not pcall(require, "rocks") then
local rocks_location = vim.fs.joinpath(vim.fn.stdpath("cache"), "rocks.nvim")
local rocks_location = vim.fs.joinpath(vim.fn.stdpath("cache") --[[@as string]], "rocks.nvim")

if not vim.uv.fs_stat(rocks_location) then
-- Pull down rocks.nvim
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/nvim-neorocks/rocks.nvim",
rocks_location,
})
local url = "https://github.com/nvim-neorocks/rocks.nvim"
vim.fn.system({ "git", "clone", "--filter=blob:none", url, rocks_location })
-- Make sure the clone was successfull
assert(vim.v.shell_error == 0, "rocks.nvim installation failed. Try exiting and re-entering Neovim!")
end

-- If the clone was successful then source the bootstrapping script
assert(vim.v.shell_error == 0, "rocks.nvim installation failed. Try exiting and re-entering Neovim!")

vim.cmd.source(vim.fs.joinpath(rocks_location, "bootstrap.lua"))

vim.fn.delete(rocks_location, "rf")
Expand Down
Loading