2017-04-14 15:39:32 -03:00
|
|
|
// Package fpm implements the Pipe interface providing FPM bindings.
|
2017-01-29 21:55:32 -02:00
|
|
|
package fpm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/goreleaser/goreleaser/context"
|
2018-02-17 13:43:29 -02:00
|
|
|
"github.com/goreleaser/goreleaser/internal/deprecate"
|
2017-12-27 09:58:42 -02:00
|
|
|
)
|
2017-12-26 21:36:17 -02:00
|
|
|
|
2017-01-29 21:55:32 -02:00
|
|
|
// Pipe for fpm packaging
|
|
|
|
type Pipe struct{}
|
|
|
|
|
2017-12-02 19:53:19 -02:00
|
|
|
func (Pipe) String() string {
|
|
|
|
return "creating Linux packages with fpm"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Default sets the pipe defaults
|
|
|
|
func (Pipe) Default(ctx *context.Context) error {
|
2018-02-26 18:49:58 -03:00
|
|
|
if len(ctx.Config.FPM.Formats) > 0 && len(ctx.Config.NFPM.Formats) == 0 {
|
2018-02-17 13:43:29 -02:00
|
|
|
deprecate.Notice("fpm")
|
2018-02-26 18:49:58 -03:00
|
|
|
ctx.Config.NFPM = ctx.Config.FPM
|
2018-02-17 13:43:29 -02:00
|
|
|
}
|
2017-12-02 19:53:19 -02:00
|
|
|
return nil
|
2017-01-29 21:55:32 -02:00
|
|
|
}
|