Fix tab writers

Signed-off-by: jolheiser <john.olheiser@gmail.com>
pull/7/head v0.0.1
jolheiser 2020-11-17 00:04:57 -06:00
parent c01d965ad7
commit 5e164b9bb9
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
2 changed files with 4 additions and 10 deletions

View File

@ -25,13 +25,10 @@ func runList(_ *cli.Context) error {
}
wr := tabwriter.NewWriter(os.Stdout, 0, 8, 0, '\t', 0)
fmt.Println("Templates")
for _, t := range reg.Templates {
if _, err := fmt.Fprintf(wr, "%s\t%s@%s\t%s", t.Name, t.Repository, t.Branch, t.Created); err != nil {
if _, err := fmt.Fprintf(wr, "%s\t%s@%s\t%s\n", t.Name, t.Repository, t.Branch, t.Created); err != nil {
return err
}
}
fmt.Println()
return nil
return wr.Flush()
}

View File

@ -55,15 +55,12 @@ func runSourceList(_ *cli.Context) error {
}
wr := tabwriter.NewWriter(os.Stdout, 0, 8, 0, '\t', 0)
fmt.Println("Sources")
for _, s := range reg.Sources {
if _, err := fmt.Fprintf(wr, "%s\t%s", s.Name, s.URL); err != nil {
if _, err := fmt.Fprintf(wr, "%s\t%s\n", s.Name, s.URL); err != nil {
return err
}
}
fmt.Println()
return nil
return wr.Flush()
}
func runSourceAdd(ctx *cli.Context) error {