feat: add hilbish.version interface

fg-job
TorchedSammy 2022-05-17 06:39:30 -04:00
parent 5dd2af7250
commit ab8b9c8376
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 8 additions and 0 deletions

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
}