Skip to content

Commit

Permalink
[v11] Manually print installer scripts instead of using asciitable (#…
Browse files Browse the repository at this point in the history
…17168)

* Dont try to print scripts in a table

* Use Fprintf

* Handle fprintf errors
  • Loading branch information
Alex McGrath authored Oct 10, 2022
1 parent a86c5e9 commit 5dc1f28
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tool/tctl/common/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -931,12 +931,16 @@ func (c *installerCollection) resources() []types.Resource {
}

func (c *installerCollection) writeText(w io.Writer) error {
t := asciitable.MakeTable([]string{"Script"})
for _, inst := range c.installers {
t.AddRow([]string{
inst.GetScript(),
})
if _, err := fmt.Fprintf(w, "Script: %s\n----------\n", inst.GetName()); err != nil {
return trace.Wrap(err)
}
if _, err := fmt.Fprintln(w, inst.GetScript()); err != nil {
return trace.Wrap(err)
}
if _, err := fmt.Fprintln(w, "----------"); err != nil {
return trace.Wrap(err)
}
}
_, err := t.AsBuffer().WriteTo(w)
return trace.Wrap(err)
return nil
}

0 comments on commit 5dc1f28

Please sign in to comment.