From 9bd478e02cb6cd9a0d670a7e4a33c24bc2bef444 Mon Sep 17 00:00:00 2001 From: William Boman Date: Wed, 6 Oct 2021 15:37:38 +0200 Subject: lemminx: fix std.rename call --- lua/nvim-lsp-installer/servers/zls/init.lua | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'lua') diff --git a/lua/nvim-lsp-installer/servers/zls/init.lua b/lua/nvim-lsp-installer/servers/zls/init.lua index a8f3c6ff..c9d32790 100644 --- a/lua/nvim-lsp-installer/servers/zls/init.lua +++ b/lua/nvim-lsp-installer/servers/zls/init.lua @@ -8,28 +8,24 @@ local std = require "nvim-lsp-installer.installers.std" local coalesce, when = Data.coalesce, Data.when return function(name, root_dir) + local archive_name = coalesce( + when(platform.is_mac and platform.arch == "x64", "x86_64-macos"), + when( + platform.is_linux, + coalesce(when(platform.arch == "x64", "x86_64-linux"), when(platform.arch == "x86", "i386-linux.tar.zx")) + ), + when(platform.is_win and platform.arch == "x64", "x86_64-windows") + ) + return server.Server:new { name = name, root_dir = root_dir, installer = { - context.github_release_file( - "zigtools/zls", - coalesce( - when(platform.is_mac and platform.arch == "x64", "x86_64-macos.tar.xz"), - when( - platform.is_linux, - coalesce( - when(platform.arch == "x64", "x86_64-linux.tar.xz"), - when(platform.arch == "x86", "i386-linux.tar.zx") - ) - ), - when(platform.is_win and platform.arch == "x64", "x86_64-windows.tar.xz") - ) - ), + context.github_release_file("zigtools/zls", ("%s.tar.xz"):format(archive_name)), context.capture(function(ctx) return std.untarxz_remote(ctx.github_release_file) end), - std.rename("x86_64-windows", "package"), + std.rename(archive_name, "package"), }, default_options = { cmd = { path.concat { root_dir, "package", "zls" } }, -- cgit v1.2.3-70-g09d2