aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lua/nvim-lsp-installer/servers/opencl_ls/init.lua26
1 files changed, 17 insertions, 9 deletions
diff --git a/lua/nvim-lsp-installer/servers/opencl_ls/init.lua b/lua/nvim-lsp-installer/servers/opencl_ls/init.lua
index 8a0af34f..5586fe6d 100644
--- a/lua/nvim-lsp-installer/servers/opencl_ls/init.lua
+++ b/lua/nvim-lsp-installer/servers/opencl_ls/init.lua
@@ -6,22 +6,30 @@ local context = require "nvim-lsp-installer.installers.context"
local Data = require "nvim-lsp-installer.data"
local coalesce, when = Data.coalesce, Data.when
+
return function(name, root_dir)
- local target = coalesce(
- when(platform.is_mac, "opencl-language-server-darwin-x86_64.zip"),
- when(platform.is_linux, coalesce(when(platform.arch == "x64", "opencl-language-server-linux-x86_64.zip"))),
- when(platform.is_win, coalesce(when(platform.arch == "x64", "opencl-language-server-win32-x86_64.zip")))
- )
return server.Server:new {
name = name,
root_dir = root_dir,
homepage = "https://github.com/Galarius/opencl-language-server",
languages = { "opencl" },
installer = {
- context.use_github_release_file("Galarius/opencl-language-server", target),
- context.capture(function(ctx)
- return std.unzip_remote(ctx.github_release_file)
- end),
+ context.use_github_release_file(
+ "Galarius/opencl-language-server",
+ coalesce(
+ when(platform.is_mac, "opencl-language-server-darwin-x86_64.tar.gz"),
+ when(platform.is_linux and platform.arch == "x64", "opencl-language-server-linux-x86_64.tar.gz"),
+ when(platform.is_win and platform.arch == "x64", "opencl-language-server-win32-x86_64.zip")
+ )
+ ),
+ context.capture(coalesce(
+ when(platform.is_unix, function(ctx)
+ return std.untargz_remote(ctx.github_release_file)
+ end),
+ when(platform.is_win, function(ctx)
+ return std.unzip_remote(ctx.github_release_file)
+ end)
+ )),
context.receipt(function(receipt, ctx)
receipt:with_primary_source(receipt.github_release_file(ctx))
end),