diff options
Diffstat (limited to 'lua/nvim-lsp-installer/servers/zk/init.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/zk/init.lua | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/servers/zk/init.lua b/lua/nvim-lsp-installer/servers/zk/init.lua new file mode 100644 index 00000000..2af55646 --- /dev/null +++ b/lua/nvim-lsp-installer/servers/zk/init.lua @@ -0,0 +1,59 @@ +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 path = require "nvim-lsp-installer.path" + +local coalesce, when = Data.coalesce, Data.when +return function(name, root_dir) + return server.Server:new { + name = name, + 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( + 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( + when(platform.arch == "arm64", function(version) + return ("zk-%s-linux-arm64.tar.gz"):format(version) + end), + when(platform.arch == "x64", function(version) + return ("zk-%s-linux-amd64.tar.gz"):format(version) + end), + 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) + )), + }, + default_options = { + cmd = { path.concat { root_dir, "zk" }, "lsp" }, + }, + } +end |
