Introduce a JSON output table mechanic

- Create JSONTable as a proxy/extension to tablewriter which can also output JSON.
- Implement machine readable output for `server list` and `recipe list`
This commit is contained in:
2023-01-10 18:51:38 -08:00
committed by Gitea
parent 89fcb5b216
commit cae0d9ef79
5 changed files with 223 additions and 10 deletions

View File

@ -7,12 +7,12 @@ import (
"coopcloud.tech/abra/pkg/app"
"coopcloud.tech/abra/pkg/config"
"coopcloud.tech/abra/pkg/formatter"
"coopcloud.tech/abra/pkg/jsontable"
"coopcloud.tech/abra/pkg/recipe"
recipePkg "coopcloud.tech/abra/pkg/recipe"
"coopcloud.tech/abra/pkg/secret"
"coopcloud.tech/abra/pkg/ssh"
"github.com/AlecAivazis/survey/v2"
"github.com/olekukonko/tablewriter"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
@ -144,7 +144,7 @@ func NewAction(c *cli.Context) error {
}
var secrets AppSecrets
var secretTable *tablewriter.Table
var secretTable *jsontable.JSONTable
if Secrets {
if err := ssh.EnsureHostKey(NewAppServer); err != nil {
logrus.Fatal(err)