aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/denols/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-09-29 13:48:39 +0200
committerGitHub <noreply@github.com>2021-09-29 13:48:39 +0200
commite267fe517feaaf7a48323349e3775944db49c158 (patch)
tree1c9d869d71c32b0d3b2f9304d9433dbb4ced9903 /lua/nvim-lsp-installer/servers/denols/init.lua
parentfix stylua (#104) (diff)
downloadmason-e267fe517feaaf7a48323349e3775944db49c158.tar
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.gz
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.bz2
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.lz
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.xz
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.zst
mason-e267fe517feaaf7a48323349e3775944db49c158.zip
support installing specific version of language servers, defaults to latest (#106)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/denols/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/denols/init.lua35
1 files changed, 22 insertions, 13 deletions
diff --git a/lua/nvim-lsp-installer/servers/denols/init.lua b/lua/nvim-lsp-installer/servers/denols/init.lua
index edaf4f21..f2131ff1 100644
--- a/lua/nvim-lsp-installer/servers/denols/init.lua
+++ b/lua/nvim-lsp-installer/servers/denols/init.lua
@@ -1,23 +1,32 @@
local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
-local installers = require "nvim-lsp-installer.installers"
-local shell = require "nvim-lsp-installer.installers.shell"
+local platform = require "nvim-lsp-installer.platform"
+local Data = require "nvim-lsp-installer.data"
+local std = require "nvim-lsp-installer.installers.std"
+local context = require "nvim-lsp-installer.installers.context"
return function(name, root_dir)
return server.Server:new {
name = name,
root_dir = root_dir,
- installer = installers.when {
- unix = shell.remote_bash("https://deno.land/x/install/install.sh", {
- env = {
- DENO_INSTALL = root_dir,
- },
- }),
- win = shell.remote_powershell("https://deno.land/x/install/install.ps1", {
- env = {
- DENO_INSTALL = root_dir,
- },
- }),
+ installer = {
+ context.github_release_file(
+ "denoland/deno",
+ Data.coalesce(
+ Data.when(
+ platform.is_mac,
+ Data.coalesce(
+ Data.when(platform.arch == "arm64", "deno-aarch64-apple-darwin.zip"),
+ Data.when(platform.arch == "x64", "deno-x86_64-apple-darwin.zip")
+ )
+ ),
+ Data.when(platform.is_linux, "deno-x86_64-unknown-linux-gnu.zip"),
+ Data.when(platform.is_win, "deno-x86_64-pc-windows-msvc.zip")
+ )
+ ),
+ context.capture(function(ctx)
+ return std.unzip_remote(ctx.github_release_file)
+ end),
},
default_options = {
cmd = { path.concat { root_dir, "bin", "deno" }, "lsp" },