diff options
Diffstat (limited to 'lua/mason-registry/sources/github.lua')
| -rw-r--r-- | lua/mason-registry/sources/github.lua | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lua/mason-registry/sources/github.lua b/lua/mason-registry/sources/github.lua index 636e8840..704c78d8 100644 --- a/lua/mason-registry/sources/github.lua +++ b/lua/mason-registry/sources/github.lua @@ -132,13 +132,6 @@ function GitHubRegistrySource:install() out_file = path.concat { self.root_dir, "registry.json.zip" }, }):map_err(_.always "Failed to download registry.json.zip.")) - local checksums = try( - fetch(settings.current.github.download_url_template:format(self.spec.repo, version, "checksums.txt")):map_err( - _.always "Failed to download checksums.txt." - ) - ) - local parsed_checksums = parse_checksums(checksums) - platform.when { unix = function() try(spawn.unzip({ "-o", "registry.json.zip", cwd = self.root_dir }):map_err(function(err) @@ -161,11 +154,17 @@ function GitHubRegistrySource:install() } pcall(fs.async.unlink, path.concat { self.root_dir, "registry.json.zip" }) + local checksums = try( + fetch(settings.current.github.download_url_template:format(self.spec.repo, version, "checksums.txt")):map_err( + _.always "Failed to download checksums.txt." + ) + ) + try(Result.pcall( fs.async.write_file, self.info_file, vim.json.encode { - checksums = parsed_checksums, + checksums = parse_checksums(checksums), version = version, download_timestamp = os.time(), } |
