Skip to content

Commit 7ed0b8b

Browse files
committed
Installers should not default to non-interactive.
1 parent 370782b commit 7ed0b8b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmd/state-installer/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func main() {
105105
OutWriter: os.Stdout,
106106
ErrWriter: os.Stderr,
107107
Colored: true,
108-
Interactive: false,
108+
Interactive: !term.IsTerminal(int(os.Stdin.Fd())),
109109
})
110110
if err != nil {
111111
multilog.Critical("Could not set up output handler: " + errs.JoinMessage(err))

cmd/state-remote-installer/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/ActiveState/cli/internal/runbits/errors"
3030
"github.com/ActiveState/cli/internal/runbits/panics"
3131
"github.com/ActiveState/cli/internal/updater"
32+
"golang.org/x/term"
3233
)
3334

3435
type Params struct {
@@ -90,7 +91,7 @@ func main() {
9091
OutWriter: os.Stdout,
9192
ErrWriter: os.Stderr,
9293
Colored: true,
93-
Interactive: false,
94+
Interactive: !term.IsTerminal(int(os.Stdin.Fd())),
9495
})
9596
if err != nil {
9697
logging.Error("Could not set up output handler: " + errs.JoinMessage(err))

0 commit comments

Comments
 (0)