Skip to content

Commit

Permalink
Inherit OS stdio in curl command
Browse files Browse the repository at this point in the history
  • Loading branch information
timdp committed Jan 4, 2023
1 parent 2105d6b commit 7e82c6b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions util/curl.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package util

import (
"bytes"
"fmt"
"os"
"os/exec"
)

Expand All @@ -33,11 +33,11 @@ func CurlCommand(cli string, header string, url string, extraArgs ...string) {
cmdArgs := append(requiredArgs, extraArgs...)

cmd := exec.Command(cli, cmdArgs...)
var out bytes.Buffer
cmd.Stdout = &out
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
fmt.Println(err)
fmt.Fprintln(os.Stderr, err)
}
print(out.String())
}

0 comments on commit 7e82c6b

Please sign in to comment.