diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-lsp-installer/server.lua | 1 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/clojure_lsp/init.lua | 14 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs | 28 |
3 files changed, 43 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/server.lua b/lua/nvim-lsp-installer/server.lua index a0b1e877..55b39d89 100644 --- a/lua/nvim-lsp-installer/server.lua +++ b/lua/nvim-lsp-installer/server.lua @@ -8,6 +8,7 @@ local _SERVERS = { "angularls", "bashls", "clangd", + "clojure_lsp", "cssls", "denols", "dockerls", diff --git a/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua b/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua new file mode 100644 index 00000000..9a235a2d --- /dev/null +++ b/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua @@ -0,0 +1,14 @@ +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("clojure_lsp") + +return server.Server:new { + name = "clojure_lsp", + root_dir = root_dir, + installer = zx.file("./install.mjs"), + default_options = { + cmd = { path.concat { root_dir, "clojure-lsp" } }, + }, +} diff --git a/lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs b/lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs new file mode 100644 index 00000000..29cbb77b --- /dev/null +++ b/lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs @@ -0,0 +1,28 @@ +const VERSION = "2021.07.01-19.49.02"; + +const exitNotSupported = () => { + console.error( + chalk.red(`${os.platform()} ${os.arch()} is currently not supported.`) + ); + process.exit(1); +}; + +const target = (() => { + switch (os.platform()) { + case "darwin": + return "clojure-lsp-native-macos-amd64.zip"; + case "win32": { + exitNotSupported(); + break; + } + default: + return "clojure-lsp-native-linux-amd64.zip"; + } +})(); + +const downloadUrl = `https://github.com/clojure-lsp/clojure-lsp/releases/download/${VERSION}/${target}`; + +await $`wget ${downloadUrl}`; +await $`unzip -o ${target}`; +await $`chmod +x clojure-lsp`; +await $`rm ${target}`; |
