diff options
| author | William Boman <william@redwill.se> | 2022-01-03 15:12:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-03 15:12:53 +0100 |
| commit | e8530f4059279a0d6b5e5f8891d04ffb1ade29a3 (patch) | |
| tree | b90ddf4479314af49e1eca3325262ef45e5f630d /lua/nvim-lsp-installer/servers/solc/init.lua | |
| parent | health: add neovim version check (diff) | |
| download | mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.gz mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.bz2 mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.lz mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.xz mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.tar.zst mason-e8530f4059279a0d6b5e5f8891d04ffb1ade29a3.zip | |
write install receipts (#379)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/solc/init.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/solc/init.lua | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lua/nvim-lsp-installer/servers/solc/init.lua b/lua/nvim-lsp-installer/servers/solc/init.lua index dd04f592..bdd2b331 100644 --- a/lua/nvim-lsp-installer/servers/solc/init.lua +++ b/lua/nvim-lsp-installer/servers/solc/init.lua @@ -9,28 +9,27 @@ local coalesce, when = Data.coalesce, Data.when return function(name, root_dir) local bin_name = platform.is_win and "solc.exe" or "solc" - return server.Server:new { name = name, root_dir = root_dir, homepage = "https://github.com/ethereum/solidity", languages = { "solidity" }, installer = { - context.capture(function(ctx) - local file_template = coalesce( - when(platform.is_mac, "macosx-amd64/solc-macosx-amd64-%s"), - when(platform.is_linux and platform.arch == "x64", "linux-amd64/solc-linux-amd64-%s"), - when(platform.is_win and platform.arch == "x64", "windows-amd64/solc-windows-amd64-%s.exe") + context.use_github_release_file( + "ethereum/solidity", + coalesce( + when(platform.is_mac, "solc-macos"), + when(platform.is_linux, "solc-static-linux"), + when(platform.is_win, "solc-windows.exe") ) - if not file_template then - error( - ("Current operating system and/or arch (%q) is currently not supported."):format(platform.arch) - ) - end - file_template = file_template:format(coalesce(ctx.requested_server_version, "latest")) - return std.download_file(("https://binaries.soliditylang.org/%s"):format(file_template), bin_name) + ), + context.capture(function(ctx) + return std.download_file(ctx.github_release_file, bin_name) end), std.chmod("+x", { bin_name }), + context.receipt(function(receipt, ctx) + receipt:with_primary_source(receipt.github_release_file(ctx)) + end), }, default_options = { cmd_env = { |
