mirror of https://github.com/folke/lazy.nvim.git
fix(rocks): hererocks paths on windows
This commit is contained in:
parent
0a5839ceea
commit
45cd8d3f0f
|
@ -21,14 +21,22 @@ function B.rockspec(task)
|
||||||
---@type table<string, string>
|
---@type table<string, string>
|
||||||
local env = {}
|
local env = {}
|
||||||
|
|
||||||
|
local luarocks = "luarocks"
|
||||||
if Config.options.rocks.hererocks then
|
if Config.options.rocks.hererocks then
|
||||||
local hererocks = Config.options.rocks.root .. "/hererocks"
|
local is_win = jit.os:find("Windows")
|
||||||
local sep = jit.os:find("Windows") and ";" or ":"
|
local sep = is_win and ";" or ":"
|
||||||
|
local hererocks = Config.options.rocks.root .. "/hererocks/bin"
|
||||||
|
if is_win then
|
||||||
|
hererocks = hererocks:gsub("/", "\\")
|
||||||
|
end
|
||||||
local path = vim.split(vim.env.PATH, sep)
|
local path = vim.split(vim.env.PATH, sep)
|
||||||
table.insert(path, 1, hererocks .. "/bin")
|
table.insert(path, 1, hererocks)
|
||||||
env = {
|
env = {
|
||||||
PATH = table.concat(path, sep),
|
PATH = table.concat(path, sep),
|
||||||
}
|
}
|
||||||
|
if is_win then
|
||||||
|
luarocks = luarocks .. ".bat"
|
||||||
|
end
|
||||||
local plugin = Config.plugins.hererocks
|
local plugin = Config.plugins.hererocks
|
||||||
-- hererocks is still building, so skip for now
|
-- hererocks is still building, so skip for now
|
||||||
if plugin and plugin._.build then
|
if plugin and plugin._.build then
|
||||||
|
@ -37,7 +45,7 @@ function B.rockspec(task)
|
||||||
end
|
end
|
||||||
|
|
||||||
local root = Config.options.rocks.root .. "/" .. task.plugin.name
|
local root = Config.options.rocks.root .. "/" .. task.plugin.name
|
||||||
task:spawn("luarocks", {
|
task:spawn(luarocks, {
|
||||||
args = {
|
args = {
|
||||||
"--tree",
|
"--tree",
|
||||||
root,
|
root,
|
||||||
|
|
Loading…
Reference in New Issue