mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 09:48:59 +02:00
fix(json): always write version to prevent spurious migrations. Fixes #1692
This commit is contained in:
parent
bd1928ba59
commit
01dbd07073
2 changed files with 7 additions and 3 deletions
|
@ -47,6 +47,7 @@ function M.encode(value)
|
|||
end
|
||||
|
||||
function M.save()
|
||||
Config.json.data.version = Config.json.version
|
||||
local path = vim.fn.stdpath("config") .. "/lazyvim.json"
|
||||
local f = io.open(path, "w")
|
||||
if f then
|
||||
|
@ -68,10 +69,13 @@ function M.migrate()
|
|||
json.data.extras = vim.tbl_map(function(extra)
|
||||
return "lazyvim.plugins.extras." .. extra
|
||||
end, json.data.extras or {})
|
||||
elseif json.data.version == 1 then
|
||||
json.data.extras = vim.tbl_map(function(extra)
|
||||
-- replace double extras module name
|
||||
return extra:gsub("^lazyvim%.plugins%.extras%.lazyvim%.plugins%.extras%.", "lazyvim.plugins.extras.")
|
||||
end, json.data.extras or {})
|
||||
end
|
||||
|
||||
json.data.version = Config.json.version
|
||||
|
||||
M.save()
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue