mirror of
https://github.com/go-task/task.git
synced 2025-09-16 09:26:16 +02:00
feat: stdin required -t - (#1623)
This commit is contained in:
@@ -30,9 +30,8 @@ func NewRootNode(
|
||||
timeout time.Duration,
|
||||
) (Node, error) {
|
||||
dir = getDefaultDir(entrypoint, dir)
|
||||
// Check if there is something to read on STDIN
|
||||
stat, _ := os.Stdin.Stat()
|
||||
if (stat.Mode()&os.ModeCharDevice) == 0 && stat.Size() > 0 {
|
||||
// If the entrypoint is "-", we read from stdin
|
||||
if entrypoint == "-" {
|
||||
return NewStdinNode(dir)
|
||||
}
|
||||
return NewNode(l, entrypoint, dir, insecure, timeout)
|
||||
|
Reference in New Issue
Block a user