fix: preserve stdin taskfile bytes (#2950)

Signed-off-by: cuishuang <imcusg@gmail.com>
This commit is contained in:
cui fliter
2026-08-10 02:55:17 +08:00
committed by GitHub
parent f174912975
commit d2b02e3c69
2 changed files with 67 additions and 11 deletions

View File

@@ -1,8 +1,7 @@
package taskfile
import (
"bufio"
"fmt"
"io"
"os"
"github.com/go-task/task/v3/internal/execext"
@@ -29,15 +28,7 @@ func (node *StdinNode) Remote() bool {
}
func (node *StdinNode) Read() ([]byte, error) {
var stdin []byte
scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() {
stdin = fmt.Appendln(stdin, scanner.Text())
}
if err := scanner.Err(); err != nil {
return nil, err
}
return stdin, nil
return io.ReadAll(os.Stdin)
}
func (node *StdinNode) ResolveEntrypoint(entrypoint string) (string, error) {