refactor: simplify startup profiles and ignore local tooling configs
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
local M = {}
|
||||
|
||||
local function to_src(value)
|
||||
if value:match("^[%w+.-]+://") or value:match("^git@") then
|
||||
return value
|
||||
end
|
||||
|
||||
return "https://github.com/" .. value
|
||||
end
|
||||
|
||||
function M.add(specs)
|
||||
local resolved = {}
|
||||
|
||||
for _, spec in ipairs(specs) do
|
||||
if type(spec) == "string" then
|
||||
table.insert(resolved, to_src(spec))
|
||||
else
|
||||
local plugin = vim.deepcopy(spec)
|
||||
plugin.src = to_src(plugin.src)
|
||||
table.insert(resolved, plugin)
|
||||
end
|
||||
end
|
||||
|
||||
vim.pack.add(resolved, { confirm = false, load = true })
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user