aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/zk/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/servers/zk/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/zk/init.lua51
1 files changed, 21 insertions, 30 deletions
diff --git a/lua/nvim-lsp-installer/servers/zk/init.lua b/lua/nvim-lsp-installer/servers/zk/init.lua
index 02a416bf..6c8825eb 100644
--- a/lua/nvim-lsp-installer/servers/zk/init.lua
+++ b/lua/nvim-lsp-installer/servers/zk/init.lua
@@ -1,9 +1,8 @@
local server = require "nvim-lsp-installer.server"
local platform = require "nvim-lsp-installer.platform"
local Data = require "nvim-lsp-installer.data"
-local std = require "nvim-lsp-installer.installers.std"
-local context = require "nvim-lsp-installer.installers.context"
local process = require "nvim-lsp-installer.process"
+local github = require "nvim-lsp-installer.core.managers.github"
local coalesce, when = Data.coalesce, Data.when
return function(name, root_dir)
@@ -12,24 +11,27 @@ return function(name, root_dir)
root_dir = root_dir,
homepage = "https://github.com/mickael-menu/zk",
languages = { "markdown" },
- installer = {
- context.use_github_release_file(
- "mickael-menu/zk",
- coalesce(
- when(
- platform.is_mac,
- coalesce(
+ async = true,
+ installer = function()
+ local repo = "mickael-menu/zk"
+ platform.when {
+ mac = function()
+ github.unzip_release_file({
+ repo = repo,
+ asset_file = coalesce(
when(platform.arch == "arm64", function(version)
return ("zk-%s-macos-arm64.zip"):format(version)
end),
when(platform.arch == "x64", function(version)
return ("zk-%s-macos-x86_64.zip"):format(version)
end)
- )
- ),
- when(
- platform.is_linux,
- coalesce(
+ ),
+ }):with_receipt()
+ end,
+ linux = function()
+ github.untargz_release_file({
+ repo = repo,
+ asset_file = coalesce(
when(platform.arch == "arm64", function(version)
return ("zk-%s-linux-arm64.tar.gz"):format(version)
end),
@@ -39,22 +41,11 @@ return function(name, root_dir)
when(platform.arch == "x86", function(version)
return ("zk-%s-linux-i386.tar.gz"):format(version)
end)
- )
- )
- )
- ),
- context.capture(coalesce(
- when(platform.is_mac, function(ctx)
- return std.unzip_remote(ctx.github_release_file)
- end),
- when(platform.is_linux, function(ctx)
- return std.untargz_remote(ctx.github_release_file)
- end)
- )),
- context.receipt(function(receipt, ctx)
- receipt:with_primary_source(receipt.github_release_file(ctx))
- end),
- },
+ ),
+ }).with_receipt()
+ end,
+ }
+ end,
default_options = {
cmd_env = {
PATH = process.extend_path { root_dir },