1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00
This commit is contained in:
Carlos Alexandro Becker 2017-03-25 21:31:16 -03:00
parent 7610138016
commit 3ce5a430ee
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
8 changed files with 8 additions and 8 deletions

View File

@ -77,7 +77,7 @@ type Project struct {
FPM FPM `yaml:"fpm"`
// test only property:
TargetFolder string `yaml:"-"`
Dist string `yaml:"-"`
}
// Load config file

View File

@ -39,7 +39,7 @@ type Archive interface {
}
func create(name string, ctx *context.Context) error {
folder := filepath.Join(ctx.Config.TargetFolder, name)
folder := filepath.Join(ctx.Config.Dist, name)
file, err := os.Create(folder + "." + ctx.Config.Archive.Format)
log.Println("Creating", file.Name())
if err != nil {

View File

@ -188,7 +188,7 @@ func dataFor(
}
sum, err := sha256sum.For(
filepath.Join(
ctx.Config.TargetFolder,
ctx.Config.Dist,
file+"."+ctx.Config.Archive.Format,
),
)

View File

@ -64,7 +64,7 @@ func (Pipe) Run(ctx *context.Context) error {
func build(name, goos, goarch string, ctx *context.Context) error {
ldflags := ctx.Config.Build.Ldflags + " -X main.version=" + ctx.Version
output := filepath.Join(
ctx.Config.TargetFolder,
ctx.Config.Dist,
name,
ctx.Config.Build.Binary+extFor(goos),
)

View File

@ -46,7 +46,7 @@ func TestRunFullPipe(t *testing.T) {
var pre = filepath.Join(folder, "pre")
var post = filepath.Join(folder, "post")
var config = config.Project{
TargetFolder: folder,
Dist: folder,
Build: config.Build{
Binary: "testing",
Flags: "-v",

View File

@ -82,7 +82,7 @@ func (Pipe) Run(ctx *context.Context) error {
if ctx.Config.Brew.Install == "" {
ctx.Config.Brew.Install = "bin.install \"" + ctx.Config.Build.Binary + "\""
}
ctx.Config.TargetFolder = "dist"
ctx.Config.Dist = "dist"
return nil
}

View File

@ -54,7 +54,7 @@ func (Pipe) Run(ctx *context.Context) error {
}
func create(ctx *context.Context, format, archive, arch string) error {
var path = filepath.Join(ctx.Config.TargetFolder, archive)
var path = filepath.Join(ctx.Config.Dist, archive)
var file = path + ".deb"
var name = ctx.Config.Build.Binary
log.Println("Creating", file)

View File

@ -89,7 +89,7 @@ func description(diff string) string {
func upload(ctx *context.Context, client *github.Client, releaseID int, archive, format string) error {
archive = archive + "." + format
var path = filepath.Join(ctx.Config.TargetFolder, archive)
var path = filepath.Join(ctx.Config.Dist, archive)
// In case the file doesn't exist, we just ignore it.
// We do this because we can get invalid combinations of archive+format here,
// like darwinamd64 + deb or something like that.