refactor: commands runner (#42)

* feat(utils): first impl of own commands runner

* refactor(gotests): uses own runner instead of vendored

* refactor(utils): back to plenary.job

* refactor(gotests): use new runner, clean code

* fix(runner): now it returns output correctly

* refactor(iferr): use vim.system

i have tried to use _utils.runner, but i can't figure out how to make `< file.go` for the command

* refactor(impl): use new runner

* refactor(installer): use new runner

* refactor(struct_tags): use new runner

* refactor: commands such as :GoGet runs with new runner

* refactor: throw errors in more lua way, i think

* refactor(utils): notify now has title

* refactor: use more correct way of notifying

* refactor(runner): write error message on error
This commit is contained in:
Smirnov Oleksandr 2023-08-10 12:04:33 +03:00
parent 011769b99b
commit 2e89cea6f3
11 changed files with 163 additions and 178 deletions

View file

@ -1,6 +1,6 @@
local tags = require "gopher.struct_tags"
local tests = require "gopher.gotests"
local uc = require "gopher._utils.commands"
local gocmd = require("gopher._utils.runner.gocmd").run
local gopher = {}
gopher.setup = require("gopher.config").setup
@ -17,19 +17,19 @@ gopher.test_exported = tests.all_exported_tests
gopher.tests_all = tests.all_tests
gopher.get = function(...)
uc("get", ...)
gocmd("get", { ... })
end
gopher.mod = function(...)
uc("mod", ...)
gocmd("mod", { ... })
end
gopher.generate = function(...)
uc("generate", ...)
gocmd("generate", { ... })
end
gopher.work = function(...)
uc("work", ...)
gocmd("work", { ... })
end
return gopher