mirror of
https://github.com/restic/restic.git
synced 2026-10-18 15:38:12 +00:00
Set output binary name in a variable.
This commit is contained in:
1 parent
d6935d6625
commit
347e800b4e
1 file changed
+6
-6
@@ -259,15 +259,15 @@ func main() {
|
|||||||
|
|
||||||
version := getVersion()
|
version := getVersion()
|
||||||
compileTime := time.Now().Format(timeFormat)
|
compileTime := time.Now().Format(timeFormat)
|
||||||
|
output := "restic"
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
output = "restic.exe"
|
||||||
|
}
|
||||||
|
|
||||||
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", output, "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...)
|
||||||
|
|||||||
Reference in new issue
Block a user