Wire up the git commit hash to the TUI banner requesting code

This commit is contained in:
David Dworken 2022-10-23 15:25:02 -07:00
parent 964359c7c5
commit 73807746a7
2 changed files with 3 additions and 3 deletions

View File

@ -205,7 +205,7 @@ func getRows(ctx *context.Context, query string) ([]table.Row, int, error) {
return rows, len(data), nil
}
func TuiQuery(ctx *context.Context, initialQuery string) error {
func TuiQuery(ctx *context.Context, gitCommit, initialQuery string) error {
lipgloss.SetColorProfile(termenv.ANSI)
columns := []table.Column{
{Title: "Hostname", Width: 25},
@ -274,7 +274,7 @@ func TuiQuery(ctx *context.Context, initialQuery string) error {
p.Send(doneDownloadingMsg{})
}()
go func() {
banner, err := GetBanner(ctx, "TODO_WIRE_GIT_COMMIT_HERE")
banner, err := GetBanner(ctx, gitCommit)
if err != nil {
if IsOfflineError(err) {
p.Send(offlineMsg{})

View File

@ -36,7 +36,7 @@ func main() {
case "tquery":
ctx := hctx.MakeContext()
lib.CheckFatalError(lib.ProcessDeletionRequests(ctx))
lib.CheckFatalError(lib.TuiQuery(ctx, strings.Join(os.Args[2:], " ")))
lib.CheckFatalError(lib.TuiQuery(ctx, GitCommit, strings.Join(os.Args[2:], " ")))
case "export":
ctx := hctx.MakeContext()
lib.CheckFatalError(lib.ProcessDeletionRequests(ctx))