1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-23 21:19:17 +02:00
Carlos Alexandro Becker 64b1f14a86
refactor: better code organization (#757)
* refactor: merging archive in the same repo

* refactor: merging archive in the same repo

* refactor: better organizing packages

* refactor: fixing renames

* fix: new dep version

* fix: makefile

* fix: zip/tar tests

* fix: gitigonore

* fix: s3 tests

* fix: archive test
2018-08-14 23:50:20 -03:00

30 lines
601 B
Go

package effectiveconfig
import (
"io/ioutil"
"path/filepath"
"github.com/apex/log"
"github.com/goreleaser/goreleaser/pkg/context"
yaml "gopkg.in/yaml.v2"
)
// 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) {
var 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 ioutil.WriteFile(path, bts, 0644)
}