Skip to content

Commit

Permalink
Fixed Oracle JDK installation on Windows 10
Browse files Browse the repository at this point in the history
  • Loading branch information
shyiko committed Jul 22, 2016
1 parent 3ee4705 commit 8665427
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions command/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,20 @@ func download(url string, fileType string) (file string, err error) {
return
}
if fileType == "exe" {
err = os.Rename(file, file + ".exe")
err = tmp.Close()
if err != nil {
return
}
tmp, err = os.OpenFile(file + ".exe", os.O_RDWR, 0600)
err = os.Rename(tmp.Name(), tmp.Name() + ".exe")
if err != nil {
return
}
tmp, err = os.OpenFile(tmp.Name() + ".exe", os.O_RDWR, 0600)
if err != nil {
return
}
}
defer tmp.Close()
file = tmp.Name()
log.Debug("Saving ", url, " to ", file)
// todo: timeout
Expand Down

0 comments on commit 8665427

Please sign in to comment.