From 347e800b4e4e29a1dd1c7b6ab8f486c886c6ea1a Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Sun, 16 Aug 2015 14:20:37 +0200 Subject: [PATCH] Set output binary name in a variable. --- build.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.go b/build.go index 94d245c4c..c62cd8574 100644 --- a/build.go +++ b/build.go @@ -259,15 +259,15 @@ func main() { version := getVersion() compileTime := time.Now().Format(timeFormat) + output := "restic" + if runtime.GOOS == "windows" { + output = "restic.exe" + } + args := []string{ "-tags", strings.Join(buildTags, " "), "-ldflags", fmt.Sprintf(`-s -X main.version %q -X main.compiledAt %q`, version, compileTime), - } - 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") + "-o", output, "github.com/restic/restic/cmd/restic", } err = build(gopath, args...)