1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

bos -> system

This commit is contained in:
Carlos Alexandro Becker 2016-12-30 10:01:40 -02:00
parent 92f1645499
commit c958d558e5
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -20,30 +20,30 @@ func (Pipe) Name() string {
func (Pipe) Work(config config.ProjectConfig) error {
var g errgroup.Group
for _, bos := range config.Build.Oses {
for _, system := range config.Build.Oses {
for _, arch := range config.Build.Arches {
bos := bos
system := system
arch := arch
g.Go(func() error {
return build(bos, arch, config)
return build(system, arch, config)
})
}
}
return g.Wait()
}
func build(bos, arch string, config config.ProjectConfig) error {
log.Println("Building", bos+"/"+arch, "...")
func build(system, arch string, config config.ProjectConfig) error {
log.Println("Building", system+"/"+arch, "...")
cmd := exec.Command(
"go",
"build",
"-ldflags=-s -w -X main.version="+config.Git.CurrentTag,
"-o", target(bos, arch, config.BinaryName),
"-o", target(system, arch, config.BinaryName),
config.Build.Main,
)
cmd.Env = append(
cmd.Env,
"GOOS="+bos,
"GOOS="+system,
"GOARCH="+arch,
"GOROOT="+os.Getenv("GOROOT"),
"GOPATH="+os.Getenv("GOPATH"),
@ -58,6 +58,6 @@ func build(bos, arch string, config config.ProjectConfig) error {
return nil
}
func target(os, arch, binary string) string {
return "dist/" + binary + "_" + uname.FromGo(os) + "_" + uname.FromGo(arch) + "/" + binary
func target(system, arch, binary string) string {
return "dist/" + binary + "_" + uname.FromGo(system) + "_" + uname.FromGo(arch) + "/" + binary
}