spin: fix isTTY check

The isTTY check is inverted in the --show-output option for spin, so no
output is shown anymore.  Fix this by correctly checking if we are a tty
or not.
This commit is contained in:
Greg Kroah-Hartman 2023-07-27 10:44:16 +02:00
parent a61f3bdc3f
commit 9829c6fc01

View file

@ -46,7 +46,7 @@ func (o Options) Run() error {
}
if o.ShowOutput {
if !isTTY {
if isTTY {
_, err := os.Stdout.WriteString(m.stdout)
if err != nil {
return fmt.Errorf("failed to write to stdout: %w", err)