mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-11 13:38:41 +02:00
fix: cleaning up
This commit is contained in:
parent
35e92aa0f4
commit
f9dbfb5d70
@ -4,11 +4,7 @@ import "github.com/goreleaser/goreleaser/internal/buildtarget"
|
||||
|
||||
// For returns the binary extension for the given platform
|
||||
func For(target buildtarget.Target) (ext string) {
|
||||
return ForOS(target.OS)
|
||||
}
|
||||
|
||||
func ForOS(os string) string {
|
||||
if os == "windows" {
|
||||
if target.OS == "windows" {
|
||||
return ".exe"
|
||||
}
|
||||
return ""
|
||||
|
@ -17,7 +17,6 @@ import (
|
||||
"github.com/goreleaser/goreleaser/context"
|
||||
"github.com/goreleaser/goreleaser/internal/archiveformat"
|
||||
"github.com/goreleaser/goreleaser/internal/artifact"
|
||||
"github.com/goreleaser/goreleaser/internal/ext"
|
||||
"github.com/goreleaser/goreleaser/internal/nametemplate"
|
||||
)
|
||||
|
||||
@ -125,7 +124,7 @@ func skip(ctx *context.Context, artifacts []artifact.Artifact) error {
|
||||
return err
|
||||
}
|
||||
a.Type = artifact.UploadableBinary
|
||||
a.Name = name + ext.ForOS(a.Goos)
|
||||
a.Name = name + a.Extra["Ext"]
|
||||
ctx.Artifacts.Add(a)
|
||||
}
|
||||
return nil
|
||||
|
@ -24,8 +24,6 @@ var ErrNoDarwin64Build = errors.New("brew tap requires one darwin amd64 build")
|
||||
// ErrTooManyDarwin64Builds when there are too many builds for darwin_amd64
|
||||
var ErrTooManyDarwin64Builds = errors.New("brew tap requires at most one darwin amd64 build")
|
||||
|
||||
const platform = "darwinamd64"
|
||||
|
||||
// Pipe for brew deployment
|
||||
type Pipe struct{}
|
||||
|
||||
|
@ -106,7 +106,8 @@ func runHook(env []string, hook string) error {
|
||||
}
|
||||
|
||||
func doBuild(ctx *context.Context, build config.Build, target buildtarget.Target) error {
|
||||
var binaryName = build.Binary + ext.For(target)
|
||||
var ext = ext.For(target)
|
||||
var binaryName = build.Binary + ext
|
||||
var binary = filepath.Join(ctx.Config.Dist, target.String(), binaryName)
|
||||
ctx.Artifacts.Add(artifact.Artifact{
|
||||
Type: artifact.Binary,
|
||||
@ -117,6 +118,7 @@ func doBuild(ctx *context.Context, build config.Build, target buildtarget.Target
|
||||
Goarm: target.Arm,
|
||||
Extra: map[string]string{
|
||||
"Binary": build.Binary,
|
||||
"Ext": ext,
|
||||
},
|
||||
})
|
||||
log.WithField("binary", binary).Info("building")
|
||||
|
Loading…
x
Reference in New Issue
Block a user