aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-registry/sources/github.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/mason-registry/sources/github.lua')
-rw-r--r--lua/mason-registry/sources/github.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/lua/mason-registry/sources/github.lua b/lua/mason-registry/sources/github.lua
index f4fd837a..ec758144 100644
--- a/lua/mason-registry/sources/github.lua
+++ b/lua/mason-registry/sources/github.lua
@@ -134,15 +134,17 @@ function GitHubRegistrySource:install()
log.trace("Resolved latest registry version", self, version)
end
- local zip_buffer = try(
- fetch(settings.current.github.download_url_template:format(self.spec.repo, version, "registry.json.zip")):map_err(
- _.always "Failed to download registry archive."
- )
- )
+ local zip_file = path.concat { self.root_dir, "registry.json.zip" }
+ try(fetch(settings.current.github.download_url_template:format(self.spec.repo, version, "registry.json.zip"), {
+ out_file = zip_file,
+ }):map_err(_.always "Failed to download registry archive."))
+ local zip_buffer = fs.async.read_file(zip_file)
local registry_contents = try(
Result.pcall(zzlib.unzip, zip_buffer, "registry.json")
+ :on_failure(_.partial(log.error, "Failed to unpack registry archive."))
:map_err(_.always "Failed to unpack registry archive.")
)
+ pcall(fs.async.unlink, zip_file)
local checksums = try(
fetch(settings.current.github.download_url_template:format(self.spec.repo, version, "checksums.txt")):map_err(