Beispiel #1
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 {
		settings = config.Merge(settings, configuredSettings)
	}
	return err
}
Beispiel #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
}