aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/texlab
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-05-17 14:37:13 +0200
committerGitHub <noreply@github.com>2021-05-17 14:37:13 +0200
commitae93866358777fcf6766152dd55980c4778f4c59 (patch)
treea1b36ba2e2aa09688c4cb96b645b03c34b728042 /lua/nvim-lsp-installer/servers/texlab
parentremove :LspInstallAll (diff)
downloadmason-ae93866358777fcf6766152dd55980c4778f4c59.tar
mason-ae93866358777fcf6766152dd55980c4778f4c59.tar.gz
mason-ae93866358777fcf6766152dd55980c4778f4c59.tar.bz2
mason-ae93866358777fcf6766152dd55980c4778f4c59.tar.lz
mason-ae93866358777fcf6766152dd55980c4778f4c59.tar.xz
mason-ae93866358777fcf6766152dd55980c4778f4c59.tar.zst
mason-ae93866358777fcf6766152dd55980c4778f4c59.zip
add support for zx install scripts (#13)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/texlab')
-rw-r--r--lua/nvim-lsp-installer/servers/texlab/init.lua21
-rw-r--r--lua/nvim-lsp-installer/servers/texlab/install.mjs21
2 files changed, 42 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/servers/texlab/init.lua b/lua/nvim-lsp-installer/servers/texlab/init.lua
new file mode 100644
index 00000000..02bb3a3e
--- /dev/null
+++ b/lua/nvim-lsp-installer/servers/texlab/init.lua
@@ -0,0 +1,21 @@
+local server = require('nvim-lsp-installer.server')
+local path = require("nvim-lsp-installer.path")
+local zx = require("nvim-lsp-installer.installers.zx")
+
+local root_dir = server.get_server_root_path('latex')
+
+return server.Server:new {
+ name = "texlab",
+ root_dir = root_dir,
+ install_cmd = zx.file("./install.mjs"),
+ 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
new file mode 100644
index 00000000..1b73bcc3
--- /dev/null
+++ b/lua/nvim-lsp-installer/servers/texlab/install.mjs
@@ -0,0 +1,21 @@
+const VERSION = "v2.2.2"
+
+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`;
+ case "win32": {
+ console.error(chalk.red("Windows is currently not supported."));
+ process.exit(1);
+ break;
+ }
+ 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`