diff options
| author | William Boman <william@redwill.se> | 2021-09-10 13:38:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-10 13:38:39 +0200 |
| commit | d2ec0c0070c01ba0e3e8926031cfe848a016df44 (patch) | |
| tree | bf57f20725e11125ed51caac547c483d4e642831 /lua/nvim-lsp-installer/servers/texlab | |
| parent | CUSTOM_SERVERS.md: update docs (diff) | |
| download | mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.gz mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.bz2 mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.lz mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.xz mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.tar.zst mason-d2ec0c0070c01ba0e3e8926031cfe848a016df44.zip | |
rewrite some installers for broader cross-platform support (#85)
- Remove all usage of zx in favour of native Lua (via libuv)
- Introduce new set of `std` installers
The following servers will have to be reinstalled due to this change:
1. clangd
2. solargraph
3. sumneko_lua
4. tailwindcss
Diffstat (limited to 'lua/nvim-lsp-installer/servers/texlab')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/texlab/init.lua | 25 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/texlab/install.mjs | 16 |
2 files changed, 14 insertions, 27 deletions
diff --git a/lua/nvim-lsp-installer/servers/texlab/init.lua b/lua/nvim-lsp-installer/servers/texlab/init.lua index c669806b..a28b4273 100644 --- a/lua/nvim-lsp-installer/servers/texlab/init.lua +++ b/lua/nvim-lsp-installer/servers/texlab/init.lua @@ -1,23 +1,26 @@ local server = require "nvim-lsp-installer.server" -local installers = require "nvim-lsp-installer.installers" local path = require "nvim-lsp-installer.path" -local zx = require "nvim-lsp-installer.installers.zx" +local std = require "nvim-lsp-installer.installers.std" +local Data = require "nvim-lsp-installer.data" +local platform = require "nvim-lsp-installer.platform" local root_dir = server.get_server_root_path "latex" +local VERSION = "v3.2.0" + +local target = Data.coalesce( + Data.when(platform.is_mac, "texlab-x86_64-macos.tar.gz"), + Data.when(platform.is_unix, "texlab-x86_64-linux.tar.gz"), + Data.when(platform.is_win, "texlab-x86_64-windows.tar.gz") +) + return server.Server:new { name = "texlab", root_dir = root_dir, - installer = installers.when { - unix = zx.file "./install.mjs", + installer = { + std.ensure_executables { "pdflatex" }, + std.untargz_remote(("https://github.com/latex-lsp/texlab/releases/download/%s/%s"):format(VERSION, target)), }, - pre_install_check = function() - if vim.fn.executable "wget" ~= 1 then - error "Missing wget. Please, refer to https://www.gnu.org/software/wget/ to install it." - elseif vim.fn.executable "pdflatex" ~= 1 then - error "The program pdflatex wasn't found. Please install a TeX distribution: https://www.latex-project.org/get/#tex-distributions" - end - end, default_options = { cmd = { path.concat { root_dir, "texlab" } }, }, diff --git a/lua/nvim-lsp-installer/servers/texlab/install.mjs b/lua/nvim-lsp-installer/servers/texlab/install.mjs deleted file mode 100644 index bc7fefe1..00000000 --- a/lua/nvim-lsp-installer/servers/texlab/install.mjs +++ /dev/null @@ -1,16 +0,0 @@ -const VERSION = "v3.2.0"; - -const platform = os.platform(); - -const target = (() => { - switch (platform) { - case "darwin": - return `https://github.com/latex-lsp/texlab/releases/download/${VERSION}/texlab-x86_64-macos.tar.gz`; - default: - return `https://github.com/latex-lsp/texlab/releases/download/${VERSION}/texlab-x86_64-linux.tar.gz`; - } -})(); - -await $`wget -O texlab.tar.gz ${target}`; -await $`tar xf texlab.tar.gz`; -await $`rm texlab.tar.gz`; |
