示例#1
0
文件: goxc.go 项目: relops/goxc
//merge configuration file
//maybe oneday: parse source
func mergeConfiguredSettings(dir string, configName string, isWriteMain, isWriteLocal bool) error {
	if settings.IsVerbose() {
		log.Printf("loading configured settings")
	}
	configuredSettings, err := config.LoadJsonConfigOverrideable(dir, configName, !isWriteMain && !isWriteLocal, isWriteLocal, settings.IsVerbose())
	if settings.IsVerbose() {
		log.Printf("Settings from config %s: %+v : %v", configName, configuredSettings, err)
	}
	//TODO: further error handling ?
	if err == nil {
		settings = config.Merge(settings, configuredSettings)
	}
	return err
}
示例#2
0
//merge configuration file
//maybe oneday: parse source
func mergeConfiguredSettings(dir string, configName string, isWriteMain, isWriteLocal bool) error {
	if settings.IsVerbose() {
		log.Printf("loading configured settings")
	}
	configuredSettings, err := config.LoadJsonConfigOverrideable(dir, configName, !isWriteMain && !isWriteLocal, isWriteLocal, settings.IsVerbose())
	if settings.IsVerbose() {
		log.Printf("Settings from config %s: %+v : %v", configName, configuredSettings, err)
	}
	//TODO: further error handling ?
	if err != nil {
		return err
	}
	// v0.14.x merge certain settings (particularly for pkg-build!)
	settings.MergeAliasedTaskSettings(tasks.TASK_ALIASES_FOR_MERGING_SETTINGS)
	configuredSettings.MergeAliasedTaskSettings(tasks.TASK_ALIASES_FOR_MERGING_SETTINGS)
	settings = config.Merge(settings, configuredSettings)
	return err
}