spin: fix isTTY check (#404)

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-28 16:40:18 +02:00 committed by GitHub
parent a61f3bdc3f
commit a63ea30136
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)