mirror of https://github.com/folke/lazy.nvim.git
feat: allow config of default for version field
This commit is contained in:
parent
334f32e595
commit
fb96183753
|
@ -7,6 +7,7 @@ M.defaults = {
|
||||||
plugins = "config.plugins",
|
plugins = "config.plugins",
|
||||||
defaults = {
|
defaults = {
|
||||||
opt = false, -- should plugins default to "opt" or "start"
|
opt = false, -- should plugins default to "opt" or "start"
|
||||||
|
version = nil,
|
||||||
-- version = "*", -- enable this to try installing the latest stable versions of plugins
|
-- version = "*", -- enable this to try installing the latest stable versions of plugins
|
||||||
},
|
},
|
||||||
dev = {
|
dev = {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
local Util = require("lazy.util")
|
local Util = require("lazy.util")
|
||||||
local Semver = require("lazy.manage.semver")
|
local Semver = require("lazy.manage.semver")
|
||||||
|
local Config = require("lazy.core.config")
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
@ -89,8 +90,9 @@ function M.get_target(plugin)
|
||||||
commit = M.ref(plugin.dir, "tags/" .. plugin.tag),
|
commit = M.ref(plugin.dir, "tags/" .. plugin.tag),
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
if plugin.version then
|
local version = plugin.version or Config.options.defaults.version
|
||||||
local last = Semver.last(M.get_versions(plugin.dir, plugin.version))
|
if version then
|
||||||
|
local last = Semver.last(M.get_versions(plugin.dir, version))
|
||||||
if last then
|
if last then
|
||||||
return {
|
return {
|
||||||
branch = branch and branch.branch,
|
branch = branch and branch.branch,
|
||||||
|
|
Loading…
Reference in New Issue