diff options
| author | Access <ShootingStarDragons@protonmail.com> | 2022-11-04 00:22:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-03 17:22:10 +0100 |
| commit | b9e8c4a1130f800e1c3b86be207ff4d5b49218c0 (patch) | |
| tree | 5265d942e977467d036ec64fe3e732ad5499e4fd /lua/mason-core | |
| parent | chore: update generated code (#623) (diff) | |
| download | mason-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>
Diffstat (limited to 'lua/mason-core')
| -rw-r--r-- | lua/mason-core/managers/github/init.lua | 4 | ||||
| -rw-r--r-- | lua/mason-core/managers/std/init.lua | 6 |
2 files changed, 7 insertions, 3 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 |
