PrintPartialFailure prints the line for an artifact the command acted on while another part of its work failed, such as an artifact saved with only some of its --attach files. The line keeps status, such as "created", so a script can tell the artifact was saved and doesn't save it again. In a termin
(ios *iostreams.IOStreams, status string, r Result, message string, err error)
| 87 | // piped line on stdout with err's reason. The command exits 1 after it, like |
| 88 | // after a failure. |
| 89 | func PrintPartialFailure(ios *iostreams.IOStreams, status string, r Result, message string, err error) { |
| 90 | reason := FailureReason(err) |
| 91 | if !ios.IsStdoutTTY() { |
| 92 | printResultLine(ios.Out, status, r, reason) |
| 93 | return |
| 94 | } |
| 95 | fmt.Fprintf(ios.ErrOut, "%s %s, but %s\n", ios.ColorScheme().WarningIcon(), message, reason) |
| 96 | } |
| 97 | |
| 98 | // printResultLine prints a piped result line. Every line has all five |
| 99 | // tab-separated columns, even empty ones, like gh pr checks rows. |