mirror of https://github.com/folke/lazy.nvim.git
feat(dev): optionally fallback to git when local plugin doesn't exist (#446)
* feat: fallback to git when local plugin isn't found * feat(option): fallback to git when local plugin doesn't exist
This commit is contained in:
parent
809d67fcf0
commit
772d8888cc
|
@ -320,6 +320,7 @@ return {
|
||||||
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"}
|
||||||
|
fallback = false, -- Fallback to git when local plugin doesn't exist
|
||||||
},
|
},
|
||||||
install = {
|
install = {
|
||||||
-- install missing plugins on startup. This doesn't increase startup time.
|
-- install missing plugins on startup. This doesn't increase startup time.
|
||||||
|
|
|
@ -31,6 +31,7 @@ M.defaults = {
|
||||||
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"}
|
||||||
|
fallback = false, -- Fallback to git when local plugin doesn't exist
|
||||||
},
|
},
|
||||||
install = {
|
install = {
|
||||||
-- install missing plugins on startup. This doesn't increase startup time.
|
-- install missing plugins on startup. This doesn't increase startup time.
|
||||||
|
|
|
@ -91,7 +91,10 @@ function Spec:add(plugin, results, is_dep)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- dev plugins
|
-- dev plugins
|
||||||
if plugin.dev then
|
if
|
||||||
|
plugin.dev
|
||||||
|
and (not Config.options.dev.fallback or vim.fn.isdirectory(Config.options.dev.path .. "/" .. plugin.name) == 1)
|
||||||
|
then
|
||||||
plugin.dir = Config.options.dev.path .. "/" .. plugin.name
|
plugin.dir = Config.options.dev.path .. "/" .. plugin.name
|
||||||
else
|
else
|
||||||
-- remote plugin
|
-- remote plugin
|
||||||
|
|
Loading…
Reference in New Issue