1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-06 03:13:48 +02:00
goreleaser/internal/pipe/effectiveconfig/config.go
Carlos Alexandro Becker fe7e2123bd
feat: replacing the log library (#3139)
* feat: replacing logs

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: tests et al

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* feat: update termenv/lipgloss

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* wip: output

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: pin dep

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: update

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: tests

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: tests

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: deps

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: dep

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-06-21 21:11:15 -03:00

29 lines
633 B
Go

package effectiveconfig
import (
"os"
"path/filepath"
"github.com/caarlos0/log"
"github.com/goreleaser/goreleaser/internal/yaml"
"github.com/goreleaser/goreleaser/pkg/context"
)
// Pipe that writes the effective config file to dist.
type Pipe struct{}
func (Pipe) String() string {
return "writing effective config file"
}
// Run the pipe.
func (Pipe) Run(ctx *context.Context) (err error) {
path := filepath.Join(ctx.Config.Dist, "config.yaml")
bts, err := yaml.Marshal(ctx.Config)
if err != nil {
return err
}
log.WithField("config", path).Info("writing")
return os.WriteFile(path, bts, 0o644) //nolint: gosec
}