aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/servers')
-rw-r--r--lua/nvim-lsp-installer/servers/clojure_lsp/init.lua14
-rw-r--r--lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs28
2 files changed, 42 insertions, 0 deletions
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}`;