diff options
| author | William Boman <william@redwill.se> | 2022-05-28 16:17:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-28 16:17:14 +0200 |
| commit | 46afeab99a29b083f27abae71b0a530bb855f609 (patch) | |
| tree | 4d4e973b7a82e164812381ef8c53600dc1939462 /lua/nvim-lsp-installer/core/managers/github | |
| parent | test(luarock): stub std.ensure_executable (#725) (diff) | |
| download | mason-46afeab99a29b083f27abae71b0a530bb855f609.tar mason-46afeab99a29b083f27abae71b0a530bb855f609.tar.gz mason-46afeab99a29b083f27abae71b0a530bb855f609.tar.bz2 mason-46afeab99a29b083f27abae71b0a530bb855f609.tar.lz mason-46afeab99a29b083f27abae71b0a530bb855f609.tar.xz mason-46afeab99a29b083f27abae71b0a530bb855f609.tar.zst mason-46afeab99a29b083f27abae71b0a530bb855f609.zip | |
refactor: use new github.download_release_file function (#728)
Diffstat (limited to 'lua/nvim-lsp-installer/core/managers/github')
| -rw-r--r-- | lua/nvim-lsp-installer/core/managers/github/init.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/core/managers/github/init.lua b/lua/nvim-lsp-installer/core/managers/github/init.lua index 10c7c049..fe4a4c5a 100644 --- a/lua/nvim-lsp-installer/core/managers/github/init.lua +++ b/lua/nvim-lsp-installer/core/managers/github/init.lua @@ -112,6 +112,14 @@ end) ---@async ---@param opts {repo: string, out_file:string, asset_file: string|fun(release: string):string} +function M.download_release_file(opts) + local release_file_source = M.release_file(opts) + std.download_file(release_file_source.download_url, assert(opts.out_file, "out_file is required")) + return release_file_source +end + +---@async +---@param opts {repo: string, out_file:string, asset_file: string|fun(release: string):string} function M.gunzip_release_file(opts) local release_file_source = M.release_file(opts) local gzipped_file = ("%s.gz"):format(assert(opts.out_file, "out_file must be specified")) |
