1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-09 13:36:56 +02:00

Config file optional

This commit is contained in:
Jorin Vogel 2017-01-14 19:29:57 +01:00
parent eaafc0a46b
commit 5ebe98b9d7

11
main.go
View File

@ -15,7 +15,6 @@ import (
"github.com/goreleaser/releaser/pipeline/git"
"github.com/goreleaser/releaser/pipeline/release"
"github.com/goreleaser/releaser/pipeline/repos"
"github.com/goreleaser/releaser/pipeline/valid"
"github.com/urfave/cli"
)
@ -28,9 +27,6 @@ var pipes = []pipeline.Pipe{
git.Pipe{},
repos.Pipe{},
// validate
valid.Pipe{},
// real work
build.Pipe{},
compress.Pipe{},
@ -52,11 +48,12 @@ func main() {
}
app.Action = func(c *cli.Context) (err error) {
var file = c.String("config")
config, err := config.Load(file)
if err != nil {
cfg, err := config.Load(file)
// Allow failing to load the config file if file is not explicitly specified
if err != nil && c.IsSet("config") {
return cli.NewExitError(err.Error(), 1)
}
context := context.New(config)
context := context.New(cfg)
log.SetFlags(0)
for _, pipe := range pipes {
log.Println(pipe.Description())