aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/spectral/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-04-21 12:09:59 +0200
committerGitHub <noreply@github.com>2022-04-21 12:09:59 +0200
commitb68fcc6bb2c770495ff8e2508c06dfdd49abcc80 (patch)
treedf7c71efb59958deb21a18eeccf3e3c43c4cd704 /lua/nvim-lsp-installer/servers/spectral/init.lua
parentrun autogen_metadata.lua (diff)
downloadmason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.gz
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.bz2
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.lz
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.xz
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.zst
mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.zip
chore: refactor remaining installers to async impl (#616)
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" },