From 5d5f3de62feab51f04b47c4a357959134051f876 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Fri, 14 Aug 2015 15:08:07 +0200 Subject: [PATCH] Output EXE file on Windows platform. --- build.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.go b/build.go index 765432f0c..94d245c4c 100644 --- a/build.go +++ b/build.go @@ -10,6 +10,7 @@ import ( "os/exec" "path" "path/filepath" + "runtime" "strings" "time" ) @@ -261,8 +262,14 @@ func main() { args := []string{ "-tags", strings.Join(buildTags, " "), "-ldflags", fmt.Sprintf(`-s -X main.version %q -X main.compiledAt %q`, version, compileTime), - "-o", "restic", "github.com/restic/restic/cmd/restic", } + if runtime.GOOS != "windows" { + args = append(args, "-o", "restic", "github.com/restic/restic/cmd/restic") + + } else { + args = append(args, "-o", "restic.exe", "github.com/restic/restic/cmd/restic") + } + err = build(gopath, args...) if err != nil { fmt.Fprintf(os.Stderr, "build failed: %v\n", err)