1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-06 03:13:48 +02:00

Merge pull request #253 from goreleaser/pretty-target

pretty target string
This commit is contained in:
Carlos Alexandro Becker 2017-06-01 12:10:46 -03:00 committed by GitHub
commit 2f60fec71c
2 changed files with 7 additions and 3 deletions

View File

@ -91,7 +91,7 @@ func run(target buildTarget, command, env []string) error {
"GOARM="+target.goarm,
)
if out, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("build failed: %s/%s %s\n%v", target.goos, target.goarch, target.goarm, string(out))
return fmt.Errorf("build failed: %s\n%v", target.PrettyString(), string(out))
}
return nil
}

View File

@ -19,14 +19,18 @@ func (t buildTarget) String() string {
return fmt.Sprintf("%v%v%v", t.goos, t.goarch, t.goarm)
}
func (t buildTarget) PrettyString() string {
return fmt.Sprintf("%v/%v%v", t.goos, t.goarch, t.goarm)
}
func buildTargets(ctx *context.Context) (targets []buildTarget) {
for _, target := range allBuildTargets(ctx) {
if !valid(target) {
log.Println("Skipped invalid build target:", target)
log.Println("Skipped invalid build target:", target.PrettyString())
continue
}
if ignored(ctx, target) {
log.Println("Skipped ignored build target:", target)
log.Println("Skipped ignored build target:", target.PrettyString())
continue
}
targets = append(targets, target)