You've already forked goreleaser
							
							
				mirror of
				https://github.com/goreleaser/goreleaser.git
				synced 2025-10-30 23:58:09 +02:00 
			
		
		
		
	Config file optional
This commit is contained in:
		
							
								
								
									
										11
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								main.go
									
									
									
									
									
								
							| @@ -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()) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user