aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/context.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-12-23 11:08:35 +0100
committerGitHub <noreply@github.com>2021-12-23 11:08:35 +0100
commitd39847e7b4d89b335e986e6931cfa8ae0d5911a8 (patch)
treeaf3a6177e423736bd0cc9f5bf28310c9529972c1 /lua/nvim-lsp-installer/installers/context.lua
parentfeat: add grammarly (#349) (diff)
downloadmason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar
mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.gz
mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.bz2
mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.lz
mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.xz
mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.tar.zst
mason-d39847e7b4d89b335e986e6931cfa8ae0d5911a8.zip
fix(ccls): better Mac support (#352)
This is a breaking change due to fundamental changes to the installer. Re-installation will unfortunately be required.
Diffstat (limited to 'lua/nvim-lsp-installer/installers/context.lua')
-rw-r--r--lua/nvim-lsp-installer/installers/context.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/installers/context.lua b/lua/nvim-lsp-installer/installers/context.lua
index 919e3957..99f679de 100644
--- a/lua/nvim-lsp-installer/installers/context.lua
+++ b/lua/nvim-lsp-installer/installers/context.lua
@@ -297,4 +297,24 @@ function M.use_os_distribution()
}
end
+function M.use_homebrew_prefix()
+ return installers.on {
+ mac = function(_, callback, ctx)
+ local stdio = process.in_memory_sink()
+ process.spawn("brew", {
+ args = { "--prefix" },
+ stdio_sink = stdio.sink,
+ }, function(success)
+ if success then
+ ctx.homebrew_prefix = vim.trim(table.concat(stdio.buffers.stdout, ""))
+ callback(true)
+ else
+ ctx.stdio_sink.stderr "Failed to locate Homebrew installation.\n"
+ callback(false)
+ end
+ end)
+ end,
+ }
+end
+
return M