Skip to content

Commit

Permalink
fix: os.OpenFile catching fds for binary during exec.Command
Browse files Browse the repository at this point in the history
  • Loading branch information
rluisr committed Oct 20, 2023
1 parent 1989551 commit a4dbc3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ func downloadAndInstallCopilot(version string, local bool) error {
if err != nil {
return err
}
defer out.Close()

_, err = io.Copy(out, resp.Body)
if err != nil {
return err
}

err = out.Close()
if err != nil {
return err
}

cmd := exec.Command(installPath, "-v")

output, err := cmd.CombinedOutput()
Expand Down

0 comments on commit a4dbc3a

Please sign in to comment.