mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Add option to provide configuration file on command line
This commit is contained in:
		@@ -26,10 +26,14 @@ It can be used for backup and capture Gogs server image to send to maintainer`,
 | 
			
		||||
	Action: runDump,
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		cli.BoolFlag{"verbose, v", "show process details", ""},
 | 
			
		||||
		cli.StringFlag{"config, c", "custom/conf/app.ini", "Configuration file", ""},
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func runDump(ctx *cli.Context) {
 | 
			
		||||
	if ctx.IsSet("config") {
 | 
			
		||||
		setting.CustomConf = ctx.String("config")
 | 
			
		||||
	}
 | 
			
		||||
	setting.NewConfigContext()
 | 
			
		||||
	models.LoadModelsConfig()
 | 
			
		||||
	models.SetEngine()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user