forked from TrueCloudLab/restic
Set output binary name in a variable.
This commit is contained in:
parent
d6935d6625
commit
347e800b4e
1 changed files with 6 additions and 6 deletions
12
build.go
12
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...)
|
||||
|
|
Loading…
Reference in a new issue