Skip to content

Commit 088ad6a

Browse files
committed
simplify stdio forwarding per review feedback
1 parent 1b78c33 commit 088ad6a

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

main.go

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -132,26 +132,8 @@ func maybeDownload(release, binDirectory, versionPath, lockFilePath, binaryPath
132132
// stdout and stderr back to the user.
133133
func run(binaryPath string) {
134134
command := exec.Command(binaryPath, os.Args[1:]...)
135-
136-
stderr, err := command.StderrPipe()
137-
if err != nil {
138-
log.Fatalf("unable to get stderr for `%v` command: %v", binaryPath, err)
139-
}
140-
141-
go func() {
142-
defer stderr.Close()
143-
io.Copy(os.Stderr, stderr)
144-
}()
145-
146-
stdout, err := command.StdoutPipe()
147-
if err != nil {
148-
log.Fatalf("unable to get stdout for `%v` command: %v", binaryPath, err)
149-
}
150-
151-
go func() {
152-
defer stdout.Close()
153-
io.Copy(os.Stdout, stdout)
154-
}()
135+
command.Stdout = os.Stdout
136+
command.Stderr = os.Stderr
155137

156138
if err := command.Start(); err != nil {
157139
log.Fatalf("unable to start `%v` command: %v", binaryPath, err)

0 commit comments

Comments
 (0)