From 8e2f53359adbca5797785d3d4a4021b3db4a0dff Mon Sep 17 00:00:00 2001 From: William Boman Date: Tue, 5 Oct 2021 20:23:29 +0200 Subject: add serve_d (#133) --- lua/nvim-lsp-installer/installers/std.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lua/nvim-lsp-installer/installers/std.lua') diff --git a/lua/nvim-lsp-installer/installers/std.lua b/lua/nvim-lsp-installer/installers/std.lua index 35c9ab21..bd1f7f61 100644 --- a/lua/nvim-lsp-installer/installers/std.lua +++ b/lua/nvim-lsp-installer/installers/std.lua @@ -52,11 +52,14 @@ function M.unzip_remote(url, dest) } end -function M.untar(file) +function M.untar(file, opts) + opts = opts or { + strip_components = 0, + } return installers.pipe { function(server, callback, context) process.spawn("tar", { - args = { "-xvf", file }, + args = { "-xvf", file, "--strip-components", opts.strip_components }, cwd = server.root_dir, stdio_sink = context.stdio_sink, }, callback) @@ -65,11 +68,17 @@ function M.untar(file) } end -function M.untargz_remote(url) +function M.untarxz_remote(url, tar_opts) + return installers.pipe { + M.download_file(url, "archive.tar.xz"), + M.untar("archive.tar.xz", tar_opts), + } +end + +function M.untargz_remote(url, tar_opts) return installers.pipe { M.download_file(url, "archive.tar.gz"), - M.gunzip "archive.tar.gz", - M.untar "archive.tar", + M.untar("archive.tar", tar_opts), } end -- cgit v1.2.3-70-g09d2