aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/ltex/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/servers/ltex/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/ltex/init.lua21
1 files changed, 5 insertions, 16 deletions
diff --git a/lua/nvim-lsp-installer/servers/ltex/init.lua b/lua/nvim-lsp-installer/servers/ltex/init.lua
index 4996eeb0..3cb8259f 100644
--- a/lua/nvim-lsp-installer/servers/ltex/init.lua
+++ b/lua/nvim-lsp-installer/servers/ltex/init.lua
@@ -4,12 +4,11 @@ local std = require "nvim-lsp-installer.installers.std"
local context = require "nvim-lsp-installer.installers.context"
local Data = require "nvim-lsp-installer.data"
local platform = require "nvim-lsp-installer.platform"
+local process = require "nvim-lsp-installer.process"
local coalesce, when = Data.coalesce, Data.when
return function(name, root_dir)
- local script_name = platform.is_win and "ltex-ls.bat" or "ltex-ls"
-
return server.Server:new {
name = name,
root_dir = root_dir,
@@ -25,29 +24,19 @@ return function(name, root_dir)
end),
context.capture(function(ctx)
if platform.is_win then
- -- todo strip components unzip
return std.unzip_remote(ctx.github_release_file)
else
return std.untargz_remote(ctx.github_release_file)
end
end),
context.capture(function(ctx)
- -- Preferably we'd not have to write a script file that captures the installed version.
- -- But in order to not break backwards compatibility for existing installations of ltex, we do it.
- return std.executable_alias(
- script_name,
- path.concat {
- root_dir,
- ("ltex-ls-%s"):format(ctx.requested_server_version),
- "bin",
- platform.is_win and "ltex-ls.bat" or "ltex-ls",
- }
- )
+ return std.rename(("ltex-ls-%s"):format(ctx.requested_server_version), "ltex-ls")
end),
- std.chmod("+x", { "ltex-ls" }),
},
default_options = {
- cmd = { path.concat { root_dir, script_name } },
+ cmd_env = {
+ PATH = process.extend_path { path.concat { root_dir, "ltex-ls", "bin" } },
+ },
},
}
end