diff options
| author | William Boman <william@redwill.se> | 2021-12-06 18:07:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-06 18:07:15 +0100 |
| commit | a415e5631fb60e373ea2536d2d17ba418e12eebe (patch) | |
| tree | 8185554c95eac18521fdfd53a6b7c3630ea56122 /lua/nvim-lsp-installer/servers | |
| parent | add quick_lint_js (#313) (diff) | |
| download | mason-a415e5631fb60e373ea2536d2d17ba418e12eebe.tar mason-a415e5631fb60e373ea2536d2d17ba418e12eebe.tar.gz mason-a415e5631fb60e373ea2536d2d17ba418e12eebe.tar.bz2 mason-a415e5631fb60e373ea2536d2d17ba418e12eebe.tar.lz mason-a415e5631fb60e373ea2536d2d17ba418e12eebe.tar.xz mason-a415e5631fb60e373ea2536d2d17ba418e12eebe.tar.zst mason-a415e5631fb60e373ea2536d2d17ba418e12eebe.zip | |
fix(quick_lint_js): use correct release files (#314)
Diffstat (limited to 'lua/nvim-lsp-installer/servers')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/quick_lint_js/init.lua | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/lua/nvim-lsp-installer/servers/quick_lint_js/init.lua b/lua/nvim-lsp-installer/servers/quick_lint_js/init.lua index 2c1d2e54..bcfe7e1b 100644 --- a/lua/nvim-lsp-installer/servers/quick_lint_js/init.lua +++ b/lua/nvim-lsp-installer/servers/quick_lint_js/init.lua @@ -3,8 +3,37 @@ local std = require "nvim-lsp-installer.installers.std" local context = require "nvim-lsp-installer.installers.context" local platform = require "nvim-lsp-installer.platform" local path = require "nvim-lsp-installer.path" +local Data = require "nvim-lsp-installer.data" + +local coalesce, when = Data.coalesce, Data.when return function(name, root_dir) + local release_file = coalesce( + when( + platform.is_mac, + coalesce( + when(platform.arch == "x64", "macos.tar.gz"), + when(platform.arch == "arm64", "macos-aarch64.tar.gz") + ) + ), + when( + platform.is_linux, + coalesce( + when(platform.arch == "x64", "linux.tar.gz"), + when(platform.arch == "arm64", "linux-aarch64.tar.gz"), + when(platform.arch == "arm", "linux-armhf.tar.gz") + ) + ), + when( + platform.is_windows, + coalesce( + when(platform.arch == "x64", "windows.zip"), + when(platform.arch == "arm64", "windows-arm64.zip"), + when(platform.arch == "arm", "windows-arm.zip") + ) + ) + ) + return server.Server:new { name = name, root_dir = root_dir, @@ -13,13 +42,11 @@ return function(name, root_dir) installer = { context.use_github_latest_tag "quick-lint/quick-lint-js", context.capture(function(ctx) - local url = "https://c.quick-lint-js.com/releases/%s/manual/%s%s" - if platform.is_mac then - return std.untargz_remote(url:format(ctx.requested_server_version, "macos", ".tar.gz")) - elseif platform.is_windows then - return std.unzip_remote(url:format(ctx.requested_server_version, "windows", ".zip")) - elseif platform.is_linux then - return std.untargz_remote(url:format(ctx.requested_server_version, "linux", ".tar.gz")) + local url = "https://c.quick-lint-js.com/releases/%s/manual/%s" + if platform.is_windows then + return std.unzip_remote(url:format(ctx.requested_server_version, release_file)) + else + return std.untargz_remote(url:format(ctx.requested_server_version, release_file)) end end), }, |
