refactor: move all plugin functionality to init.lua
This commit is contained in:
parent
94250bb08a
commit
1c0eeb3a86
2 changed files with 33 additions and 32 deletions
|
|
@ -1,29 +0,0 @@
|
||||||
local API = {}
|
|
||||||
local tags = require "gopher.struct_tags"
|
|
||||||
local tests = require "gopher.gotests"
|
|
||||||
local cmd = require "gopher._utils.commands"
|
|
||||||
|
|
||||||
API.install_deps = require "gopher.installer"
|
|
||||||
API.tags_add = tags.add
|
|
||||||
API.tags_rm = tags.remove
|
|
||||||
API.impl = require "gopher.impl"
|
|
||||||
API.iferr = require "gopher.iferr"
|
|
||||||
API.comment = require "gopher.comment"
|
|
||||||
API.test_add = tests.func_test
|
|
||||||
API.test_exported = tests.all_exported_tests
|
|
||||||
API.tests_all = tests.all_tests
|
|
||||||
|
|
||||||
API.get = function(...)
|
|
||||||
cmd("get", ...)
|
|
||||||
end
|
|
||||||
API.mod = function(...)
|
|
||||||
cmd("mod", ...)
|
|
||||||
end
|
|
||||||
API.generate = function(...)
|
|
||||||
cmd("generate", ...)
|
|
||||||
end
|
|
||||||
API.work = function(...)
|
|
||||||
cmd("work", ...)
|
|
||||||
end
|
|
||||||
|
|
||||||
return API
|
|
||||||
|
|
@ -1,5 +1,35 @@
|
||||||
local GOPHER = {}
|
local tags = require "gopher.struct_tags"
|
||||||
|
local tests = require "gopher.gotests"
|
||||||
|
local uc = require "gopher._utils.commands"
|
||||||
|
local gopher = {}
|
||||||
|
|
||||||
GOPHER.setup = require("gopher.config").setup
|
gopher.setup = require("gopher.config").setup
|
||||||
|
gopher.install_deps = require "gopher.installer"
|
||||||
|
gopher.impl = require "gopher.impl"
|
||||||
|
gopher.iferr = require "gopher.iferr"
|
||||||
|
gopher.comment = require "gopher.comment"
|
||||||
|
|
||||||
return GOPHER
|
gopher.tags_add = tags.add
|
||||||
|
gopher.tags_rm = tags.remove
|
||||||
|
|
||||||
|
gopher.test_add = tests.func_test
|
||||||
|
gopher.test_exported = tests.all_exported_tests
|
||||||
|
gopher.tests_all = tests.all_tests
|
||||||
|
|
||||||
|
gopher.get = function(...)
|
||||||
|
uc("get", ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
gopher.mod = function(...)
|
||||||
|
uc("mod", ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
gopher.generate = function(...)
|
||||||
|
uc("generate", ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
gopher.work = function(...)
|
||||||
|
uc("work", ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
return gopher
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue