refactor(installer): return function instead of M
This commit is contained in:
parent
bc235b7cd3
commit
932c0aa0c3
2 changed files with 7 additions and 11 deletions
|
|
@ -1,13 +1,11 @@
|
|||
local Job = require "plenary.job"
|
||||
local M = {
|
||||
urls = {
|
||||
gomodifytags = "github.com/fatih/gomodifytags",
|
||||
impl = "github.com/josharian/impl",
|
||||
},
|
||||
local urls = {
|
||||
gomodifytags = "github.com/fatih/gomodifytags",
|
||||
impl = "github.com/josharian/impl",
|
||||
}
|
||||
|
||||
local function install(pkg)
|
||||
local url = M.urls[pkg] .. "@latest"
|
||||
local url = urls[pkg] .. "@latest"
|
||||
|
||||
Job
|
||||
:new({
|
||||
|
|
@ -26,10 +24,8 @@ local function install(pkg)
|
|||
end
|
||||
|
||||
---Install required go deps
|
||||
function M.install_all()
|
||||
for pkg, _ in pairs(M.urls) do
|
||||
return function()
|
||||
for pkg, _ in pairs(urls) do
|
||||
install(pkg)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue