diff options
| author | William Boman <william@redwill.se> | 2021-10-05 20:23:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-05 20:23:29 +0200 |
| commit | 8e2f53359adbca5797785d3d4a4021b3db4a0dff (patch) | |
| tree | b1a6ff2969ea96a7747628b9d5b44bfe7918cbbb /lua/nvim-lsp-installer/installers/std.lua | |
| parent | README: fix available lsp list (diff) | |
| download | mason-8e2f53359adbca5797785d3d4a4021b3db4a0dff.tar mason-8e2f53359adbca5797785d3d4a4021b3db4a0dff.tar.gz mason-8e2f53359adbca5797785d3d4a4021b3db4a0dff.tar.bz2 mason-8e2f53359adbca5797785d3d4a4021b3db4a0dff.tar.lz mason-8e2f53359adbca5797785d3d4a4021b3db4a0dff.tar.xz mason-8e2f53359adbca5797785d3d4a4021b3db4a0dff.tar.zst mason-8e2f53359adbca5797785d3d4a4021b3db4a0dff.zip | |
add serve_d (#133)
Diffstat (limited to 'lua/nvim-lsp-installer/installers/std.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/installers/std.lua | 19 |
1 files changed, 14 insertions, 5 deletions
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 |
