refactor(cmd/joj3)!: conf #51
|  | @ -160,22 +160,24 @@ func parseConfFile(path string) (conf Conf, err error) { | |||
| 		return | ||||
| 	} | ||||
| 	// TODO: remove the following backward compatibility codes
 | ||||
| 	conf.Stage.SandboxExecServer = conf.SandboxExecServer | ||||
| 	conf.Stage.SandboxToken = conf.SandboxToken | ||||
| 	conf.Stage.OutputPath = conf.OutputPath | ||||
| 	conf.Stage.Stages = make([]ConfStage, len(conf.Stages)) | ||||
| 	for i, stage := range conf.Stages { | ||||
| 		conf.Stage.Stages[i].Name = stage.Name | ||||
| 		conf.Stage.Stages[i].Group = stage.Group | ||||
| 		conf.Stage.Stages[i].Executor = stage.Executor | ||||
| 		conf.Stage.Stages[i].Parsers = []struct { | ||||
| 			Name string | ||||
| 			With interface{} | ||||
| 		}{ | ||||
| 			{ | ||||
| 				Name: stage.Parser.Name, | ||||
| 				With: stage.Parser.With, | ||||
| 			}, | ||||
| 	if len(conf.Stage.Stages) == 0 { | ||||
| 		conf.Stage.SandboxExecServer = conf.SandboxExecServer | ||||
| 		conf.Stage.SandboxToken = conf.SandboxToken | ||||
| 		conf.Stage.OutputPath = conf.OutputPath | ||||
| 		conf.Stage.Stages = make([]ConfStage, len(conf.Stages)) | ||||
| 		for i, stage := range conf.Stages { | ||||
| 			conf.Stage.Stages[i].Name = stage.Name | ||||
| 			conf.Stage.Stages[i].Group = stage.Group | ||||
| 			conf.Stage.Stages[i].Executor = stage.Executor | ||||
| 			conf.Stage.Stages[i].Parsers = []struct { | ||||
| 				Name string | ||||
| 				With interface{} | ||||
| 			}{ | ||||
| 				{ | ||||
| 					Name: stage.Parser.Name, | ||||
| 					With: stage.Parser.With, | ||||
| 				}, | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	return | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user