aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAccess <ShootingStarDragons@protonmail.com>2022-11-04 00:22:10 +0800
committerGitHub <noreply@github.com>2022-11-03 17:22:10 +0100
commitb9e8c4a1130f800e1c3b86be207ff4d5b49218c0 (patch)
tree5265d942e977467d036ec64fe3e732ad5499e4fd
parentchore: update generated code (#623) (diff)
downloadmason-b9e8c4a1130f800e1c3b86be207ff4d5b49218c0.tar
mason-b9e8c4a1130f800e1c3b86be207ff4d5b49218c0.tar.gz
mason-b9e8c4a1130f800e1c3b86be207ff4d5b49218c0.tar.bz2
mason-b9e8c4a1130f800e1c3b86be207ff4d5b49218c0.tar.lz
mason-b9e8c4a1130f800e1c3b86be207ff4d5b49218c0.tar.xz
mason-b9e8c4a1130f800e1c3b86be207ff4d5b49218c0.tar.zst
mason-b9e8c4a1130f800e1c3b86be207ff4d5b49218c0.zip
fix(zls): support zst (#622)
Co-authored-by: William Boman <william@redwill.se>
-rw-r--r--lua/mason-core/managers/github/init.lua4
-rw-r--r--lua/mason-core/managers/std/init.lua6
-rw-r--r--lua/mason-registry/zls/init.lua12
3 files changed, 14 insertions, 8 deletions
diff --git a/lua/mason-core/managers/github/init.lua b/lua/mason-core/managers/github/init.lua
index cf1e05f4..5f1df1ec 100644
--- a/lua/mason-core/managers/github/init.lua
+++ b/lua/mason-core/managers/github/init.lua
@@ -131,6 +131,10 @@ M.unzip_release_file = release_file_processor("archive.zip", function()
std.unzip("archive.zip", ".")
end)
+M.untarzst_release_file = release_file_processor("archive.tar.zst", function(opts)
+ std.untar("archive.tar.zst", { strip_components = opts.strip_components })
+end)
+
M.untarxz_release_file = release_file_processor("archive.tar.xz", function(opts)
std.untarxz("archive.tar.xz", { strip_components = opts.strip_components })
end)
diff --git a/lua/mason-core/managers/std/init.lua b/lua/mason-core/managers/std/init.lua
index 2e699de6..18c56b21 100644
--- a/lua/mason-core/managers/std/init.lua
+++ b/lua/mason-core/managers/std/init.lua
@@ -76,7 +76,7 @@ function M.unzip(file, dest)
end
---@param file string
-local function win_extract(file)
+local function win_decompress(file)
local ctx = installer.context()
Result.run_catching(function()
ctx.spawn.gzip { "-d", file }
@@ -125,7 +125,7 @@ function M.untarxz(file, opts)
end,
win = function()
Result.run_catching(function()
- win_extract(file) -- unpack .tar.xz to .tar
+ win_decompress(file) -- unpack .tar.xz to .tar
local uncompressed_tar = file:gsub(".xz$", "")
M.untar(uncompressed_tar, opts)
end):recover(function()
@@ -151,7 +151,7 @@ function M.gunzip(file)
ctx.spawn.gzip { "-d", file }
end,
win = function()
- win_extract(file)
+ win_decompress(file)
end,
}
end
diff --git a/lua/mason-registry/zls/init.lua b/lua/mason-registry/zls/init.lua
index 93b9f399..da65201a 100644
--- a/lua/mason-registry/zls/init.lua
+++ b/lua/mason-registry/zls/init.lua
@@ -17,13 +17,15 @@ return Pkg.new {
---@param ctx InstallContext
install = function(ctx)
local asset_file = coalesce(
- when(platform.is.mac, "x86_64-macos.tar.xz"),
- when(platform.is.linux_x64, "x86_64-linux.tar.xz"),
- when(platform.is.linux_x86, "i386-linux.tar.xz"),
- when(platform.is.win_x64, "x86_64-windows.tar.xz")
+ when(platform.is.mac_arm64, "aarch64-macos.tar.zst"),
+ when(platform.is.mac_x64, "x86_64-macos.tar.zst"),
+ when(platform.is.linux_x64, "x86_64-linux.tar.zst"),
+ when(platform.is.linux_x86, "i386-linux.tar.zst"),
+ when(platform.is.win_x64, "i386-windows.tar.zst"),
+ when(platform.is.win_x64, "x86_64-windows.tar.zst")
)
github
- .untarxz_release_file({
+ .untarzst_release_file({
repo = "zigtools/zls",
asset_file = asset_file,
})