From 8a1a49b9e8147b4c1a3314739720357c0ba1ed1a Mon Sep 17 00:00:00 2001 From: MordechaiHadad <33547558+MordechaiHadad@users.noreply.github.com> Date: Mon, 9 Jan 2023 12:12:30 +0200 Subject: feat(rust-analyzer): use .zip archives on Windows (#873) Co-authored-by: William Boman --- lua/mason-registry/rust-analyzer/init.lua | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'lua') diff --git a/lua/mason-registry/rust-analyzer/init.lua b/lua/mason-registry/rust-analyzer/init.lua index 6b25461a..27294e29 100644 --- a/lua/mason-registry/rust-analyzer/init.lua +++ b/lua/mason-registry/rust-analyzer/init.lua @@ -24,17 +24,29 @@ return Pkg.new { when(platform.is.linux_x64_gnu, "rust-analyzer-x86_64-unknown-linux-gnu.gz"), when(platform.is.linux_arm64_gnu, "rust-analyzer-aarch64-unknown-linux-gnu.gz"), when(platform.is.linux_x64_musl, "rust-analyzer-x86_64-unknown-linux-musl.gz"), - when(platform.is.win_arm64, "rust-analyzer-aarch64-pc-windows-msvc.gz"), - when(platform.is.win_x64, "rust-analyzer-x86_64-pc-windows-msvc.gz") + when(platform.is.win_arm64, "rust-analyzer-aarch64-pc-windows-msvc.zip"), + when(platform.is.win_x64, "rust-analyzer-x86_64-pc-windows-msvc.zip") ) - github - .gunzip_release_file({ - repo = "rust-lang/rust-analyzer", - asset_file = asset_file, - out_file = platform.is.win and "rust-analyzer.exe" or "rust-analyzer", - }) - .with_receipt() + platform.when { + unix = function() + github + .gunzip_release_file({ + repo = "rust-lang/rust-analyzer", + asset_file = asset_file, + out_file = "rust-analyzer", + }) + .with_receipt() + end, + win = function() + github + .unzip_release_file({ + repo = "rust-lang/rust-analyzer", + asset_file = asset_file, + }) + .with_receipt() + end, + } std.chmod("+x", { "rust-analyzer" }) ctx:link_bin("rust-analyzer", platform.is.win and "rust-analyzer.exe" or "rust-analyzer") end, -- cgit v1.2.3-70-g09d2