aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorMordechaiHadad <33547558+MordechaiHadad@users.noreply.github.com>2023-01-09 12:12:30 +0200
committerGitHub <noreply@github.com>2023-01-09 11:12:30 +0100
commit8a1a49b9e8147b4c1a3314739720357c0ba1ed1a (patch)
tree64772c1fa483f26e5204a29b48672c8078ef759e /lua
parentchore: update generated code (#874) (diff)
downloadmason-8a1a49b9e8147b4c1a3314739720357c0ba1ed1a.tar
mason-8a1a49b9e8147b4c1a3314739720357c0ba1ed1a.tar.gz
mason-8a1a49b9e8147b4c1a3314739720357c0ba1ed1a.tar.bz2
mason-8a1a49b9e8147b4c1a3314739720357c0ba1ed1a.tar.lz
mason-8a1a49b9e8147b4c1a3314739720357c0ba1ed1a.tar.xz
mason-8a1a49b9e8147b4c1a3314739720357c0ba1ed1a.tar.zst
mason-8a1a49b9e8147b4c1a3314739720357c0ba1ed1a.zip
feat(rust-analyzer): use .zip archives on Windows (#873)
Co-authored-by: William Boman <william@redwill.se>
Diffstat (limited to 'lua')
-rw-r--r--lua/mason-registry/rust-analyzer/init.lua30
1 files changed, 21 insertions, 9 deletions
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,