mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-11 09:52:31 +00:00
[options] Properly handle dev.path as a function
This commit is contained in:
parent
d8f26efd45
commit
ae66638f72
2 changed files with 4 additions and 2 deletions
|
@ -679,7 +679,7 @@ will be added to the plugin’s spec.
|
||||||
dev = {
|
dev = {
|
||||||
-- Directory where you store your local plugin projects. If a function is used,
|
-- Directory where you store your local plugin projects. If a function is used,
|
||||||
-- the plugin directory (e.g. `~/projects/plugin-name`) must be returned.
|
-- the plugin directory (e.g. `~/projects/plugin-name`) must be returned.
|
||||||
---@type string | fun(plugin: LazyPlugin): string
|
---@type string | fun(): string
|
||||||
path = "~/projects",
|
path = "~/projects",
|
||||||
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
||||||
patterns = {}, -- For example {"folke"}
|
patterns = {}, -- For example {"folke"}
|
||||||
|
|
|
@ -69,7 +69,7 @@ M.defaults = {
|
||||||
dev = {
|
dev = {
|
||||||
-- Directory where you store your local plugin projects. If a function is used,
|
-- Directory where you store your local plugin projects. If a function is used,
|
||||||
-- the plugin directory (e.g. `~/projects/plugin-name`) must be returned.
|
-- the plugin directory (e.g. `~/projects/plugin-name`) must be returned.
|
||||||
---@type string | fun(plugin: LazyPlugin): string
|
---@type string | fun(): string
|
||||||
path = "~/projects",
|
path = "~/projects",
|
||||||
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
|
||||||
patterns = {}, -- For example {"folke"}
|
patterns = {}, -- For example {"folke"}
|
||||||
|
@ -286,6 +286,8 @@ function M.setup(opts)
|
||||||
M.options.root = Util.norm(M.options.root)
|
M.options.root = Util.norm(M.options.root)
|
||||||
if type(M.options.dev.path) == "string" then
|
if type(M.options.dev.path) == "string" then
|
||||||
M.options.dev.path = Util.norm(M.options.dev.path)
|
M.options.dev.path = Util.norm(M.options.dev.path)
|
||||||
|
else
|
||||||
|
M.options.dev.path = Util.norm(M.options.dev.path())
|
||||||
end
|
end
|
||||||
M.options.lockfile = Util.norm(M.options.lockfile)
|
M.options.lockfile = Util.norm(M.options.lockfile)
|
||||||
M.options.readme.root = Util.norm(M.options.readme.root)
|
M.options.readme.root = Util.norm(M.options.readme.root)
|
||||||
|
|
Loading…
Add table
Reference in a new issue