add a description field to modules
This commit is contained in:
parent
fd1c5d6e79
commit
561f1d8f8b
1 changed files with 3 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ local packager = require("dep.package")
|
|||
|
||||
---@class module
|
||||
---@field name string name of the module
|
||||
---@field desc string description of the module
|
||||
---@field path string path to the module
|
||||
---@field mod table the module
|
||||
local module = {}
|
||||
|
|
@ -22,6 +23,7 @@ function module:new(modpath, prefix, overrides)
|
|||
setmetatable(o, self)
|
||||
|
||||
o.name = "<unnamed module>"
|
||||
o.desc = "<undescribed module>"
|
||||
if type(modpath) == "string" then
|
||||
if prefix ~= nil then
|
||||
if prefix:sub(#prefix) ~= "." and modpath:sub(1, 2) ~= "." then
|
||||
|
|
@ -38,6 +40,7 @@ function module:new(modpath, prefix, overrides)
|
|||
end
|
||||
end
|
||||
o.name = o.mod.name or o.name
|
||||
o.desc = o.mod.desc or o.desc
|
||||
|
||||
-- allow a module to be a spec
|
||||
if spec_man.check(o.mod, true) ~= false then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue