go.nvim/lua/go/mod.lua

22 lines
391 B
Lua
Raw Normal View History

2022-02-21 22:46:59 +00:00
local runner = require("go.runner")
2022-03-16 13:05:07 +00:00
local utils = require("go.utils")
2022-02-21 22:46:59 +00:00
local M = {}
-- args: tidy or vendor
2022-03-16 13:05:07 +00:00
function M.run(...)
local args = { ... }
2022-02-21 22:46:59 +00:00
local cmd = { "go", "mod" }
2022-05-15 04:09:07 +00:00
cmd = vim.list_extend(cmd, args)
utils.log(cmd)
2022-02-21 22:46:59 +00:00
local opts = {
on_exit = function()
2022-02-21 22:46:59 +00:00
vim.schedule(function()
utils.restart()
2022-03-16 13:05:07 +00:00
end)
2022-02-21 22:46:59 +00:00
end,
}
2022-03-16 13:05:07 +00:00
runner.run(cmd, opts)
2022-02-21 22:46:59 +00:00
end
return M