Commit b7b47836 authored by Joe Poirier's avatar Joe Poirier Committed by Andrew Gerrand

misc/dist: fix Windows breakage

The files could use some attention on the
Windows side but better to wait until after
the upcoming release.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7621044
parent ecc17432
......@@ -386,9 +386,13 @@ func (b *Build) tour() error {
}
// Copy gotour binary to tool directory as "tour"; invoked as "go tool tour".
gotour := "gotour"
if runtime.GOOS == "windows" {
gotour = "gotour.exe"
}
return cp(
filepath.Join(b.root, "pkg", "tool", b.OS+"_"+b.Arch, "tour"),
filepath.Join(b.gopath, "bin", "gotour"),
filepath.Join(b.gopath, "bin", gotour),
)
}
......@@ -620,8 +624,11 @@ func cp(dst, src string) error {
return err
}
defer df.Close()
if err := df.Chmod(fi.Mode()); err != nil {
return err
// Windows doesn't currently implement Fchmod
if runtime.GOOS != "windows" {
if err := df.Chmod(fi.Mode()); err != nil {
return err
}
}
_, err = io.Copy(df, sf)
return err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment