diff options
| author | William Boman <william@redwill.se> | 2022-01-02 15:11:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-02 15:11:07 +0100 |
| commit | 451587d3a891e596ecfce1e9b0e77747d9d4d7cb (patch) | |
| tree | e465c0f49b13bba8db7e8498c6a9e7833b6c6897 /lua/nvim-lsp-installer/servers/taplo/init.lua | |
| parent | add taplo (#373) (diff) | |
| download | mason-451587d3a891e596ecfce1e9b0e77747d9d4d7cb.tar mason-451587d3a891e596ecfce1e9b0e77747d9d4d7cb.tar.gz mason-451587d3a891e596ecfce1e9b0e77747d9d4d7cb.tar.bz2 mason-451587d3a891e596ecfce1e9b0e77747d9d4d7cb.tar.lz mason-451587d3a891e596ecfce1e9b0e77747d9d4d7cb.tar.xz mason-451587d3a891e596ecfce1e9b0e77747d9d4d7cb.tar.zst mason-451587d3a891e596ecfce1e9b0e77747d9d4d7cb.zip | |
fix(taplo): use github release files instead (#377)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/taplo/init.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/taplo/init.lua | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/lua/nvim-lsp-installer/servers/taplo/init.lua b/lua/nvim-lsp-installer/servers/taplo/init.lua index 2aacdaef..cb4de20a 100644 --- a/lua/nvim-lsp-installer/servers/taplo/init.lua +++ b/lua/nvim-lsp-installer/servers/taplo/init.lua @@ -1,5 +1,12 @@ local server = require "nvim-lsp-installer.server" -local cargo = require "nvim-lsp-installer.installers.cargo" +local context = require "nvim-lsp-installer.installers.context" +local platform = require "nvim-lsp-installer.platform" +local installers = require "nvim-lsp-installer.installers" +local Data = require "nvim-lsp-installer.data" +local std = require "nvim-lsp-installer.installers.std" +local path = require "nvim-lsp-installer.path" + +local coalesce, when = Data.coalesce, Data.when return function(name, root_dir) return server.Server:new { @@ -7,9 +14,27 @@ return function(name, root_dir) root_dir = root_dir, languages = { "toml" }, homepage = "https://taplo.tamasfe.dev/lsp/", - installer = cargo.crates { "taplo-lsp" }, + installer = { + context.use_github_release_file( + "tamasfe/taplo", + coalesce( + when(platform.is_mac, "taplo-lsp-x86_64-apple-darwin-gnu.tar.gz"), + when(platform.is_linux and platform.arch == "x64", "taplo-lsp-x86_64-unknown-linux.tar.gz"), + when(platform.is_win and platform.arch == "x64", "taplo-lsp-windows-x86_64.zip") + ), + { + tag_name_pattern = "^release%-lsp%-", + } + ), + context.capture(function(ctx) + return installers.when { + unix = std.untargz_remote(ctx.github_release_file), + win = std.unzip_remote(ctx.github_release_file), + } + end), + }, default_options = { - cmd = { cargo.executable(root_dir, "taplo-lsp"), "run" }, + cmd = { path.concat { root_dir, "taplo-lsp" }, "run" }, }, } end |
