mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
feat: improved fpm output
Only enable fpm's debug mode when goreleaser is in debug as well.
This commit is contained in:
parent
d9f13a3b12
commit
3064e11b31
@ -42,6 +42,7 @@ type Context struct {
|
||||
Publish bool
|
||||
Snapshot bool
|
||||
RmDist bool
|
||||
Debug bool
|
||||
Parallelism int
|
||||
}
|
||||
|
||||
|
@ -69,6 +69,7 @@ func Release(flags Flags) error {
|
||||
}
|
||||
var ctx = context.New(cfg)
|
||||
ctx.Parallelism = flags.Int("parallelism")
|
||||
ctx.Debug = flags.Bool("debug")
|
||||
log.Debugf("parallelism: %v", ctx.Parallelism)
|
||||
ctx.Validate = !flags.Bool("skip-validate")
|
||||
ctx.Publish = !flags.Bool("skip-publish")
|
||||
|
@ -2,7 +2,6 @@
|
||||
package fpm
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os/exec"
|
||||
@ -13,6 +12,7 @@ import (
|
||||
"github.com/goreleaser/goreleaser/context"
|
||||
"github.com/goreleaser/goreleaser/internal/linux"
|
||||
"github.com/goreleaser/goreleaser/pipeline"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
@ -101,7 +101,7 @@ func create(ctx *context.Context, format, folder, arch string, binaries []contex
|
||||
|
||||
log.WithField("args", options).Debug("creating fpm package")
|
||||
if out, err := exec.Command("fpm", options...).CombinedOutput(); err != nil {
|
||||
return errors.New(string(out))
|
||||
return errors.Wrap(err, string(out))
|
||||
}
|
||||
ctx.AddArtifact(file)
|
||||
return nil
|
||||
@ -117,7 +117,10 @@ func basicOptions(ctx *context.Context, workdir, format, arch, file string) []st
|
||||
"--package", file,
|
||||
"--force",
|
||||
"--workdir", workdir,
|
||||
"--debug",
|
||||
}
|
||||
|
||||
if ctx.Debug {
|
||||
options = append(options, "--debug")
|
||||
}
|
||||
|
||||
if ctx.Config.FPM.Vendor != "" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user