aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/spectral/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/servers/spectral/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/spectral/init.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/lua/nvim-lsp-installer/servers/spectral/init.lua b/lua/nvim-lsp-installer/servers/spectral/init.lua
index 61047942..8b174d22 100644
--- a/lua/nvim-lsp-installer/servers/spectral/init.lua
+++ b/lua/nvim-lsp-installer/servers/spectral/init.lua
@@ -13,14 +13,14 @@ return function(name, root_dir)
---@param ctx InstallContext
installer = function(ctx)
git.clone({ "https://github.com/stoplightio/vscode-spectral" }).with_receipt()
- local server_dir = path.concat { ctx.cwd:get(), "server" }
ctx.spawn.npm { "install" }
- ctx.spawn.npm { "install", cwd = server_dir }
+ ctx:chdir("server", function()
+ ctx.spawn.npm { "install" }
+ end)
pcall(npm.run, { "compile" })
- -- TODO: don't do this
- ctx.cwd:set(server_dir)
- ctx.receipt:mark_invalid() -- Due to the `context.set_working_dir` after clone, we essentially erase any trace of the cloned git repo, so we mark this as invalid.
+ ctx:chdir "server"
+ ctx.receipt:mark_invalid() -- Due to the `chdir`, we essentially erase any trace of the cloned git repo, so we mark this as invalid.
end,
default_options = {
cmd = { "node", path.concat { root_dir, "out", "server.js" }, "--stdio" },