1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-22 15:57:07 +00:00

Output EXE file on Windows platform.

This commit is contained in:
Klaus Post 2015-08-14 15:08:07 +02:00
parent dc842ffa09
commit 5d5f3de62f

View file

@ -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)