1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-19 20:57:53 +02:00

fix: better universalbinary message (#4627)

<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

...

<!-- Why is this change being made? -->

...

<!-- # Provide links to any relevant tickets, URLs or other resources
-->

...

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2024-02-12 22:36:21 -03:00 committed by GitHub
parent c9cc1065b4
commit b33f14c0fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/caarlos0/go-shellwords"
"github.com/caarlos0/log"
@ -157,7 +158,7 @@ func makeUniversalBinary(ctx *context.Context, opts *build.Options, unibin confi
binaries := ctx.Artifacts.Filter(filterFor(unibin)).List()
if len(binaries) == 0 {
return pipe.Skipf("no darwin binaries found with id %q", unibin.ID)
return pipe.Skipf("no darwin binaries found with ids: %s", strings.Join(unibin.IDs, ", "))
}
log.WithField("id", unibin.ID).

View File

@ -149,7 +149,7 @@ func TestRun(t *testing.T) {
UniversalBinaries: []config.UniversalBinary{
{
ID: "notfoo",
IDs: []string{"notfoo"},
IDs: []string{"notfoo", "notbar"},
NameTemplate: "notfoo",
},
},
@ -294,7 +294,7 @@ func TestRun(t *testing.T) {
})
t.Run("no darwin builds", func(t *testing.T) {
require.EqualError(t, Pipe{}.Run(ctx3), `no darwin binaries found with id "notfoo"`)
require.EqualError(t, Pipe{}.Run(ctx3), `no darwin binaries found with ids: notfoo, notbar`)
})
t.Run("fail to open", func(t *testing.T) {

View File

@ -16,6 +16,9 @@ universal_binaries:
# IDs to use to filter the built binaries.
#
# Notice that you shouldn't include different apps' IDs here.
# This field is usually only required if you are using CGO.
#
# Default: the value of the id field
# Since: v1.3
ids: