Skip to content

Programmatically get the path for installations #33

Answered by williamboman
oldgalileo asked this question in Q&A
Discussion options

You must be logged in to vote

I haven't fully figured out the nicest way this could be done, so the following is subject to change in the future, but for now you can do this:

local mason_registry = require("mason-registry")
local codelldb = mason_registry.get_package("codelldb") -- note that this will error if you provide a non-existent package name
codelldb:get_install_path() -- returns a string like "/home/user/.local/share/nvim/mason/packages/codelldb"

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@przbadu
Comment options

@przbadu
Comment options

@DuyTC1811
Comment options

@TomzBench
Comment options

Answer selected by oldgalileo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants