2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-03-31 18:53:22 +00:00

feat: add hilbish.version interface

This commit is contained in:
TorchedSammy 2022-05-17 06:39:30 -04:00
parent 5dd2af7250
commit ab8b9c8376
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

8
api.go
View File

@ -174,6 +174,14 @@ Check out the {blue}{bold}guide{reset} command to get started.
util.Document(editorModule, "")
mod.Set(rt.StringValue("editor"), rt.TableValue(editorModule))
versionModule := rt.NewTable()
util.SetField(rtm, versionModule, "branch", rt.StringValue(gitBranch), "Git branch Hilbish was compiled from")
util.SetField(rtm, versionModule, "full", rt.StringValue(getVersion()), "Full version info, including release name")
util.SetField(rtm, versionModule, "commit", rt.StringValue(gitCommit), "Git commit Hilbish was compiled from")
util.SetField(rtm, versionModule, "release", rt.StringValue(releaseName), "Release name")
util.Document(versionModule, "Version info interface.")
mod.Set(rt.StringValue("version"), rt.TableValue(versionModule))
return rt.TableValue(fakeMod), nil
}