Skip to content

Commit a2d5f6a

Browse files
committed
chore: allow to know if we are in a tty
Signed-off-by: Yves Brissaud <[email protected]>
1 parent 2265af8 commit a2d5f6a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

runkit/run.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
"mvdan.cc/sh/v3/expand"
1111
"mvdan.cc/sh/v3/interp"
1212
"mvdan.cc/sh/v3/syntax"
13+
14+
"github.com/eunomie/docker-runx/internal/tui"
1315
)
1416

1517
type (
@@ -27,6 +29,7 @@ type (
2729
Env map[string]string
2830
Opts map[string]string
2931
Dockerfile string
32+
IsTTY bool
3033
}
3134
)
3235

@@ -57,8 +60,9 @@ func (action *Action) GetRunnable(ref string) (*Runnable, func(), error) {
5760
Action: action,
5861
command: rootCommand,
5962
data: TemplateData{
60-
Ref: ref,
61-
Env: map[string]string{},
63+
Ref: ref,
64+
Env: map[string]string{},
65+
IsTTY: tui.IsATTY(os.Stdin.Fd()),
6266
},
6367
}
6468

0 commit comments

Comments
 (0)