forked from TrueCloudLab/restic
Output EXE file on Windows platform.
This commit is contained in:
parent
dc842ffa09
commit
5d5f3de62f
1 changed files with 8 additions and 1 deletions
9
build.go
9
build.go
|
@ -10,6 +10,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -261,8 +262,14 @@ func main() {
|
||||||
args := []string{
|
args := []string{
|
||||||
"-tags", strings.Join(buildTags, " "),
|
"-tags", strings.Join(buildTags, " "),
|
||||||
"-ldflags", fmt.Sprintf(`-s -X main.version %q -X main.compiledAt %q`, version, compileTime),
|
"-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...)
|
err = build(gopath, args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "build failed: %v\n", err)
|
fmt.Fprintf(os.Stderr, "build failed: %v\n", err)
|
||||||
|
|
Loading…
Reference in a new issue